]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
maint: adjust code to handle "error" syntax-check changes
authorPádraig Brady <P@draigBrady.com>
Wed, 31 May 2023 16:21:08 +0000 (17:21 +0100)
committerPádraig Brady <P@draigBrady.com>
Wed, 31 May 2023 16:24:13 +0000 (17:24 +0100)
* 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.

src/dd.c
src/stty.c

index 8fcfdd3dbb6306efe3f2e7501b5d5707bddf9b04..665fc831c50caf217ec25c2458e29c91e5ad9aff 100644 (file)
--- 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;
         }
index 607a4e7bb3410763499e4c748e1f1882e49990dc..966c1c3a086c5d61eeeaf3a854ba519254e17872 100644 (file)
@@ -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));
     }
 }