diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2024-04-13 15:03:37 -0400 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2024-04-13 15:03:37 -0400 |
| commit | fab547ebc84a6f8913e1c5c7cd6b0f4598f5382c (patch) | |
| tree | a5f980c2ca7bffd73fbfd1354761c3d55f17f500 /compile.c | |
| parent | 63e6ba596ae8e35727289a69b11d5640bfc5e49e (diff) | |
Fix issue with empty command line args
Diffstat (limited to 'compile.c')
| -rw-r--r-- | compile.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -1904,7 +1904,7 @@ static CORD compile_main_arg_parser(env_t *env, const char *module_name, type_t usage = CORD_all(usage, "<", flag, ">"); } } - code = CORD_all(code, "CORD $usage = CORD_all(\"Usage: \", argv[0], ", Text$quoted(usage, false), ");\n", + code = CORD_all(code, "CORD $usage = CORD_all(\"Usage: \", argv[0], ", usage ? Text$quoted(usage, false) : "CORD_EMPTY", ");\n", "#define $USAGE_ERR(...) errx(1, CORD_to_const_char_star(CORD_all(__VA_ARGS__)))\n" "#define $IS_FLAG(str, flag) (strncmp(str, flag, strlen(flag) == 0 && (str[strlen(flag)] == 0 || str[strlen(flag)] == '=')) == 0)\n"); |
