1
0
mirror of git://git.sv.gnu.org/coreutils.git synced 2026-07-28 19:39:52 +02:00

maint: address syntax-check issues in recent commit

* cfg.mk (sc_die_EXIT_FAILURE): Generalize to match any EXIT_ define,
and also relax to ignore error() usage with ternary operator.
* src/chroot.c (main): Use () to avoid the sc_error_quotes check.
This commit is contained in:
Pádraig Brady
2022-03-07 22:39:32 +00:00
parent 92cb8427c5
commit 8767d75b9d
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -192,7 +192,7 @@ sc_prohibit_quotes_notation:
# Files in src/ should quote all strings in error() output, so that
# unexpected input chars like \r etc. don't corrupt the error.
# In edge cases this can be avoided by putting the format string
# on a separate line to the following arguments.
# on a separate line to the arguments, or the arguments in parenthesis.
sc_error_quotes:
@cd $(srcdir)/src && GIT_PAGER= git grep -n 'error *(.*%s.*, [^(]*);$$'\
*.c | grep -v ', q' \
@@ -236,7 +236,7 @@ sc_error_shell_always_quotes:
# to the compiler that it doesn't return.
sc_die_EXIT_FAILURE:
@cd $(srcdir)/src && GIT_PAGER= git grep -E \
'error \(.*_(FAILURE|INVALID)' \
'error \([^?]*EXIT_' \
&& { echo '$(ME): '"Use die() instead of error" 1>&2; \
exit 1; } \
|| :
+1 -1
View File
@@ -358,7 +358,7 @@ main (int argc, char **argv)
char const *err = parse_user_spec_warn (userspec, &uid, &gid,
NULL, NULL, &warn);
if (err)
error (warn ? 0 : EXIT_CANCELED, 0, "%s", err);
error (warn ? 0 : EXIT_CANCELED, 0, "%s", (err));
}
/* If no gid is supplied or looked up, do so now.