summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2005-06-16 21:44:25 +0000
committerJim Meyering <jim@meyering.net>2005-06-16 21:44:25 +0000
commitc95fdb837288fd304217de84b319cabb8dffadbb (patch)
tree16a30c3412de7598bf52375685ec57d6e810ad92 /src
parentf682977c0cce43713d0e4a112fc3dbb4fa58d013 (diff)
downloadcoreutils-c95fdb837288fd304217de84b319cabb8dffadbb.tar.xz
Don't embed `this'-style quotes in format strings.
Include "quote.h". Rather than this: error (..., "...`%s'...", arg); do this: error (..., "...%s...", quote (arg));
Diffstat (limited to 'src')
-rw-r--r--src/factor.c5
-rw-r--r--src/stty.c21
2 files changed, 14 insertions, 12 deletions
diff --git a/src/factor.c b/src/factor.c
index 06987c814..3066d65e6 100644
--- a/src/factor.c
+++ b/src/factor.c
@@ -30,6 +30,7 @@
#include "error.h"
#include "inttostr.h"
#include "long-options.h"
+#include "quote.h"
#include "readtokens.h"
#include "xstrtol.h"
@@ -153,9 +154,9 @@ print_factors (const char *s)
if ((err = xstrtoumax (s, NULL, 10, &n, "")) != LONGINT_OK)
{
if (err == LONGINT_OVERFLOW)
- error (0, 0, _("`%s' is too large"), s);
+ error (0, 0, _("%s is too large"), quote (s));
else
- error (0, 0, _("`%s' is not a valid positive integer"), s);
+ error (0, 0, _("%s is not a valid positive integer"), quote (s));
return false;
}
n_factors = factor (n, MAX_N_FACTORS, factors);
diff --git a/src/stty.c b/src/stty.c
index d77b88e2f..3756e4687 100644
--- a/src/stty.c
+++ b/src/stty.c
@@ -56,6 +56,7 @@
#include "system.h"
#include "error.h"
+#include "quote.h"
#include "vasprintf.h"
#include "xstrtol.h"
@@ -882,7 +883,7 @@ main (int argc, char **argv)
}
if (!match_found & reversed)
{
- error (0, 0, _("invalid argument `%s'"), arg - 1);
+ error (0, 0, _("invalid argument %s"), quote (arg - 1));
usage (EXIT_FAILURE);
}
if (!match_found)
@@ -893,7 +894,7 @@ main (int argc, char **argv)
{
if (k == argc - 1)
{
- error (0, 0, _("missing argument to `%s'"), arg);
+ error (0, 0, _("missing argument to %s"), quote (arg));
usage (EXIT_FAILURE);
}
match_found = true;
@@ -910,7 +911,7 @@ main (int argc, char **argv)
{
if (k == argc - 1)
{
- error (0, 0, _("missing argument to `%s'"), arg);
+ error (0, 0, _("missing argument to %s"), quote (arg));
usage (EXIT_FAILURE);
}
++k;
@@ -922,7 +923,7 @@ main (int argc, char **argv)
{
if (k == argc - 1)
{
- error (0, 0, _("missing argument to `%s'"), arg);
+ error (0, 0, _("missing argument to %s"), quote (arg));
usage (EXIT_FAILURE);
}
++k;
@@ -935,7 +936,7 @@ main (int argc, char **argv)
{
if (k == argc - 1)
{
- error (0, 0, _("missing argument to `%s'"), arg);
+ error (0, 0, _("missing argument to %s"), quote (arg));
usage (EXIT_FAILURE);
}
++k;
@@ -947,7 +948,7 @@ main (int argc, char **argv)
{
if (k == argc - 1)
{
- error (0, 0, _("missing argument to `%s'"), arg);
+ error (0, 0, _("missing argument to %s"), quote (arg));
usage (EXIT_FAILURE);
}
++k;
@@ -967,13 +968,13 @@ main (int argc, char **argv)
unsigned long int value;
if (k == argc - 1)
{
- error (0, 0, _("missing argument to `%s'"), arg);
+ error (0, 0, _("missing argument to %s"), quote (arg));
usage (EXIT_FAILURE);
}
++k;
mode.c_line = value = integer_arg (argv[k], ULONG_MAX);
if (mode.c_line != value)
- error (0, 0, _("invalid line discipline `%s'"), argv[k]);
+ error (0, 0, _("invalid line discipline %s"), quote (argv[k]));
require_set_attr = true;
}
#endif
@@ -992,7 +993,7 @@ main (int argc, char **argv)
{
if (! recover_mode (arg, &mode))
{
- error (0, 0, _("invalid argument `%s'"), arg);
+ error (0, 0, _("invalid argument %s"), quote (arg));
usage (EXIT_FAILURE);
}
require_set_attr = true;
@@ -1886,7 +1887,7 @@ integer_arg (const char *s, unsigned long int maxval)
if (xstrtoul (s, NULL, 0, &value, "bB") != LONGINT_OK
|| maxval < value)
{
- error (0, 0, _("invalid integer argument `%s'"), s);
+ error (0, 0, _("invalid integer argument %s"), quote (s));
usage (EXIT_FAILURE);
}
return value;