diff options
author | Jim Meyering <jim@meyering.net> | 2005-06-16 21:33:43 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 2005-06-16 21:33:43 +0000 |
commit | 3787d01a51c110a513e9b6fafa6c5c641399f2ce (patch) | |
tree | c49427a07fa046ae09d5f9fcef4c8c6b1ffb0f7f /src | |
parent | 0441b743b0e89b12900f9085600846d2e5d0ceaf (diff) | |
download | coreutils-3787d01a51c110a513e9b6fafa6c5c641399f2ce.tar.xz |
Don't embed `this'-style quotes in format strings.
Rather than this: error (..., "...`%s'...", arg);
do this: error (..., "...%s...", quote (arg));
Diffstat (limited to 'src')
-rw-r--r-- | src/csplit.c | 18 | ||||
-rw-r--r-- | src/date.c | 8 | ||||
-rw-r--r-- | src/hostname.c | 2 | ||||
-rw-r--r-- | src/join.c | 4 | ||||
-rw-r--r-- | src/ptx.c | 2 | ||||
-rw-r--r-- | src/seq.c | 2 | ||||
-rw-r--r-- | src/sort.c | 12 | ||||
-rw-r--r-- | src/split.c | 2 | ||||
-rw-r--r-- | src/tail.c | 20 |
9 files changed, 35 insertions, 35 deletions
diff --git a/src/csplit.c b/src/csplit.c index d49e30eb1..d7e2f208f 100644 --- a/src/csplit.c +++ b/src/csplit.c @@ -710,8 +710,8 @@ handle_line_error (const struct control *p, uintmax_t repetition) { char buf[INT_BUFSIZE_BOUND (uintmax_t)]; - fprintf (stderr, _("%s: `%s': line number out of range"), - program_name, umaxtostr (p->lines_required, buf)); + fprintf (stderr, _("%s: %s: line number out of range"), + program_name, quote (umaxtostr (p->lines_required, buf))); if (repetition) fprintf (stderr, _(" on repetition %s\n"), umaxtostr (repetition, buf)); else @@ -756,8 +756,8 @@ static void regexp_error (struct control *, uintmax_t, bool) ATTRIBUTE_NORETURN; static void regexp_error (struct control *p, uintmax_t repetition, bool ignore) { - fprintf (stderr, _("%s: `%s': match not found"), - program_name, global_argv[p->argnum]); + fprintf (stderr, _("%s: %s: match not found"), + program_name, quote (global_argv[p->argnum])); if (repetition) { @@ -985,7 +985,7 @@ close_output_file (void) { if (ferror (output_stream)) { - error (0, 0, _("write error for `%s'"), output_filename); + error (0, 0, _("write error for %s"), quote (output_filename)); output_stream = NULL; cleanup_fatal (); } @@ -1172,14 +1172,14 @@ parse_patterns (int argc, int start, char **argv) { char buf[INT_BUFSIZE_BOUND (uintmax_t)]; error (EXIT_FAILURE, 0, - _("line number `%s' is smaller than preceding line number, %s"), - argv[i], umaxtostr (last_val, buf)); + _("line number %s is smaller than preceding line number, %s"), + quote (argv[i]), umaxtostr (last_val, buf)); } if (val == last_val) error (0, 0, - _("warning: line number `%s' is the same as preceding line number"), - argv[i]); + _("warning: line number %s is the same as preceding line number"), + quote (argv[i])); last_val = val; diff --git a/src/date.c b/src/date.c index c1136faa4..b2af224bd 100644 --- a/src/date.c +++ b/src/date.c @@ -273,7 +273,7 @@ batch_convert (const char *input_filename, const char *format) { if (line[line_length - 1] == '\n') line[line_length - 1] = '\0'; - error (0, 0, _("invalid date `%s'"), line); + error (0, 0, _("invalid date %s"), quote (line)); ok = false; } else @@ -384,10 +384,10 @@ main (int argc, char **argv) && n_args == 1 && argv[optind][0] != '+') { error (0, 0, _("\ -the argument `%s' lacks a leading `+';\n\ +the argument %s lacks a leading `+';\n\ When using an option to specify date(s), any non-option\n\ argument must be a format string beginning with `+'."), - argv[optind]); + quote (argv[optind])); usage (EXIT_FAILURE); } @@ -452,7 +452,7 @@ argument must be a format string beginning with `+'."), } if (! valid_date) - error (EXIT_FAILURE, 0, _("invalid date `%s'"), datestr); + error (EXIT_FAILURE, 0, _("invalid date %s"), quote (datestr)); if (set_date) { diff --git a/src/hostname.c b/src/hostname.c index 082c89143..0abe64e21 100644 --- a/src/hostname.c +++ b/src/hostname.c @@ -100,7 +100,7 @@ main (int argc, char **argv) /* Set hostname to operand. */ char const *name = argv[optind]; if (sethostname (name, strlen (name)) != 0) - error (EXIT_FAILURE, errno, _("cannot set name to `%s'"), name); + error (EXIT_FAILURE, errno, _("cannot set name to %s"), quote (name)); #else error (EXIT_FAILURE, 0, _("cannot set hostname; this system lacks the functionality")); diff --git a/src/join.c b/src/join.c index 8f4461206..979186c80 100644 --- a/src/join.c +++ b/src/join.c @@ -879,8 +879,8 @@ main (int argc, char **argv) if (STREQ (optarg, "\\0")) newtab = '\0'; else - error (EXIT_FAILURE, 0, _("multi-character tab `%s'"), - optarg); + error (EXIT_FAILURE, 0, _("multi-character tab %s"), + quote (optarg)); } if (0 <= tab && tab != newtab) error (EXIT_FAILURE, 0, _("incompatible tabs")); @@ -407,7 +407,7 @@ alloc_and_compile_regex (const char *string) message = re_compile_pattern (string, (int) strlen (string), pattern); if (message) - error (EXIT_FAILURE, 0, _("%s (for regexp `%s')"), message, string); + error (EXIT_FAILURE, 0, _("%s (for regexp %s)"), message, quote (string)); /* The fastmap should be compiled before `re_match'. The following call is not mandatory, because `re_search' is always called sooner, @@ -376,7 +376,7 @@ main (int argc, char **argv) if (format_str && !valid_format (format_str)) { - error (0, 0, _("invalid format string: `%s'"), format_str); + error (0, 0, _("invalid format string: %s"), quote (format_str)); usage (EXIT_FAILURE); } diff --git a/src/sort.c b/src/sort.c index 7ba36ca33..2b583d21c 100644 --- a/src/sort.c +++ b/src/sort.c @@ -1985,8 +1985,8 @@ static void badfieldspec (char const *, char const *) static void badfieldspec (char const *spec, char const *msgid) { - error (SORT_FAILURE, 0, _("%s: invalid field specification `%s'"), - _(msgid), spec); + error (SORT_FAILURE, 0, _("%s: invalid field specification %s"), + _(msgid), quote (spec)); abort (); } @@ -2018,8 +2018,8 @@ parse_field_count (char const *string, size_t *val, char const *msgid) case LONGINT_INVALID: if (msgid) - error (SORT_FAILURE, 0, _("%s: invalid count at start of `%s'"), - _(msgid), string); + error (SORT_FAILURE, 0, _("%s: invalid count at start of %s"), + _(msgid), quote (string)); return NULL; } @@ -2360,8 +2360,8 @@ main (int argc, char **argv) "multi-character tab" instead of "multibyte tab", so that the diagnostic's wording does not need to be changed once multibyte characters are supported. */ - error (SORT_FAILURE, 0, _("multi-character tab `%s'"), - optarg); + error (SORT_FAILURE, 0, _("multi-character tab %s"), + quote (optarg)); } } if (tab != TAB_DEFAULT && tab != newtab) diff --git a/src/split.c b/src/split.c index 631fd0430..95cb05cbd 100644 --- a/src/split.c +++ b/src/split.c @@ -211,7 +211,7 @@ cwrite (bool new_file_flag, const char *bp, size_t bytes) next_file_name (); if (verbose) - fprintf (stderr, _("creating file `%s'\n"), outfile); + fprintf (stderr, _("creating file %s\n"), quote (outfile)); output_desc = fd_safer (open (outfile, O_WRONLY | O_CREAT | O_TRUNC | O_BINARY, (S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP diff --git a/src/tail.c b/src/tail.c index 522cadf96..104e9f8a7 100644 --- a/src/tail.c +++ b/src/tail.c @@ -877,8 +877,8 @@ recheck (struct File_spec *f, bool blocking) unreadable (perms), and later becomes readable again and can be seen to be the same file (dev/ino). Otherwise, tail prints the entire contents of the file when it becomes readable. */ - error (0, f->errnum, _("`%s' has become inaccessible"), - pretty_name (f)); + error (0, f->errnum, _("%s has become inaccessible"), + quote (pretty_name (f))); } else { @@ -894,9 +894,9 @@ recheck (struct File_spec *f, bool blocking) { ok = false; f->errnum = -1; - error (0, 0, _("`%s' has been replaced with an untailable file;\ + error (0, 0, _("%s has been replaced with an untailable file;\ giving up on this name"), - pretty_name (f)); + quote (pretty_name (f))); f->ignore = true; } else @@ -915,7 +915,7 @@ recheck (struct File_spec *f, bool blocking) { new_file = true; assert (f->fd == -1); - error (0, 0, _("`%s' has become accessible"), pretty_name (f)); + error (0, 0, _("%s has become accessible"), quote (pretty_name (f))); } else if (f->ino != new_stats.st_ino || f->dev != new_stats.st_dev) { @@ -923,8 +923,8 @@ recheck (struct File_spec *f, bool blocking) if (f->fd == -1) { error (0, 0, - _("`%s' has appeared; following end of new file"), - pretty_name (f)); + _("%s has appeared; following end of new file"), + quote (pretty_name (f))); } else { @@ -934,8 +934,8 @@ recheck (struct File_spec *f, bool blocking) /* File has been replaced (e.g., via log rotation) -- tail the new one. */ error (0, 0, - _("`%s' has been replaced; following end of new file"), - pretty_name (f)); + _("%s has been replaced; following end of new file"), + quote (pretty_name (f))); } } else @@ -1446,7 +1446,7 @@ parse_obsolete_option (int argc, char * const *argv, uintmax_t *n_units) else if ((xstrtoumax (n_string, NULL, 10, n_units, "b") & ~LONGINT_INVALID_SUFFIX_CHAR) != LONGINT_OK) - error (EXIT_FAILURE, 0, _("number in `%s' is too large"), argv[1]); + error (EXIT_FAILURE, 0, _("number in %s is too large"), quote (argv[1])); /* Set globals. */ from_start = t_from_start; |