Better debug & warning output re: wordexp() shell expansion

This commit is contained in:
Bill Kendrick 2023-06-03 14:17:03 -07:00
parent fe33acc716
commit 65f3c805d1

View file

@ -27756,13 +27756,13 @@ static void parse_file_options(struct cfginfo *restrict tmpcfg, const char *file
wordexp(arg, &result, 0); wordexp(arg, &result, 0);
if (result.we_wordv != NULL) if (result.we_wordv != NULL)
{ {
DEBUG_PRINTF("wordexp result.we_wordv of `%s` was `%s`\n", str, result.we_wordv[0]); DEBUG_PRINTF("wordexp result.we_wordv of '%s' was '%s'\n", str, result.we_wordv[0]);
arg = strdup(result.we_wordv[0]); arg = strdup(result.we_wordv[0]);
wordfree(&result); wordfree(&result);
} }
else else
{ {
fprintf(stderr, "Shell expansion of `%s` failed! (You probably need to wrap it in quotes (\")!)\n", str); fprintf(stderr, "Shell expansion of '%s' on line %d of '%s' failed! (You probably need to wrap it in quotes (\")!)\n", str, line, filename);
continue; continue;
} }
#endif #endif