From: Pádraig Brady Date: Wed, 31 May 2023 16:21:08 +0000 (+0100) Subject: maint: adjust code to handle "error" syntax-check changes X-Git-Tag: v9.4~122 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d055228e341d36a7b79057eb2285d4ead69ae808;p=thirdparty%2Fcoreutils.git maint: adjust code to handle "error" syntax-check changes * src/dd.c: Don't include no longer used error.h. Use quoteaf() rather than quote() to quote appropriate for the shell and to avoid the syntax-check failure, * src/stty.c: Use quoteaf() rather than quotef() to have more consistent quoting of the invalid arg. --- diff --git a/src/dd.c b/src/dd.c index 8fcfdd3dbb..665fc831c5 100644 --- a/src/dd.c +++ b/src/dd.c @@ -25,7 +25,6 @@ #include "alignalloc.h" #include "close-stream.h" #include "die.h" -#include "error.h" #include "fd-reopen.h" #include "gethrxtime.h" #include "human.h" @@ -1498,7 +1497,7 @@ scanargs (int argc, char *const *argv) if (val == NULL) { - diagnose (0, _("unrecognized operand %s"), quote (name)); + diagnose (0, _("unrecognized operand %s"), quoteaf (name)); usage (EXIT_FAILURE); } val++; @@ -1576,7 +1575,7 @@ scanargs (int argc, char *const *argv) } else { - diagnose (0, _("unrecognized operand %s"), quote (name)); + diagnose (0, _("unrecognized operand %s"), quoteaf (name)); usage (EXIT_FAILURE); } @@ -1587,7 +1586,7 @@ scanargs (int argc, char *const *argv) if (invalid != LONGINT_OK) die (EXIT_FAILURE, invalid == LONGINT_OVERFLOW ? EOVERFLOW : 0, - "%s: %s", _("invalid number"), quote (val)); + "%s: %s", _("invalid number"), quoteaf (val)); else if (converted_idx) *converted_idx = n; } diff --git a/src/stty.c b/src/stty.c index 607a4e7bb3..966c1c3a08 100644 --- a/src/stty.c +++ b/src/stty.c @@ -1732,13 +1732,13 @@ set_speed (enum speed_setting type, char const *arg, struct termios *mode) { last_ibaud = baud; if (cfsetispeed (mode, baud)) - die (EXIT_FAILURE, 0, "unsupported ispeed %s", quotef (arg)); + die (EXIT_FAILURE, 0, "unsupported ispeed %s", quoteaf (arg)); } if (type == output_speed || type == both_speeds) { last_obaud = baud; if (cfsetospeed (mode, baud)) - die (EXIT_FAILURE, 0, "unsupported ospeed %s", quotef (arg)); + die (EXIT_FAILURE, 0, "unsupported ospeed %s", quoteaf (arg)); } }