Miscellaneous refactoring of code and docs (#1411)

This commit is contained in:
Sylvie
2024-06-18 14:47:31 -04:00
committed by GitHub
parent 623c3f662c
commit ee748cfe26
4 changed files with 18 additions and 18 deletions

View File

@@ -566,7 +566,7 @@ void lexer_CheckRecursionDepth() {
}
static bool isMacroChar(char c) {
return c == '@' || c == '#' || c == '<' || (c > '0' && c <= '9');
return c == '@' || c == '#' || c == '<' || (c >= '1' && c <= '9');
}
// forward declarations for readBracketedMacroArgNum
@@ -670,7 +670,7 @@ static std::shared_ptr<std::string> readMacroArg(char name) {
error("Invalid macro argument '\\0'\n");
return nullptr;
} else {
assume(name > '0' && name <= '9');
assume(name >= '1' && name <= '9');
MacroArgs *macroArgs = fstk_GetCurrentMacroArgs();
if (!macroArgs) {

View File

@@ -174,12 +174,12 @@ int main(int argc, char *argv[]) {
case 'M':
if (dependFile)
warnx("Overriding dependfile %s", dependFileName);
if (!strcmp("-", musl_optarg)) {
dependFile = stdout;
dependFileName = "<stdout>";
} else {
if (strcmp("-", musl_optarg)) {
dependFile = fopen(musl_optarg, "w");
dependFileName = musl_optarg;
} else {
dependFile = stdout;
dependFileName = "<stdout>";
}
if (dependFile == nullptr)
err("Failed to open dependfile \"%s\"", dependFileName);