summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharles Levert <charles_levert@gna.org>2005-11-11 12:17:50 +0000
committerCharles Levert <charles_levert@gna.org>2005-11-11 12:17:50 +0000
commit3ce20d6b08fc9c1a99db6946c2da1fb38a17009b (patch)
tree799f42287e1ddd287bade6384e12a7f7d46cefd9
parent02bee574acb67bd41069455ef495970fb7621e9b (diff)
downloadgrep-3ce20d6b08fc9c1a99db6946c2da1fb38a17009b.tar.gz
* src/grep.c (parse_grep_colors, main): Replace all uses of
fprintf(stderr, _("%s: foo\n"), program_name, ...) with error(0, 0, _("foo"), ...) for uniformization and simplification of warning messages that will be up for localization. (My bad.)
-rw-r--r--ChangeLog5
-rw-r--r--src/grep.c27
2 files changed, 16 insertions, 16 deletions
diff --git a/ChangeLog b/ChangeLog
index 6f3459a9..54821265 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -10,6 +10,11 @@
patterns cannot just be replaced by '|' to create an alternation as
back-references are assumed to be local to each individual pattern.
+ * src/grep.c (parse_grep_colors, main): Replace all uses of
+ fprintf(stderr, _("%s: foo\n"), program_name, ...) with
+ error(0, 0, _("foo"), ...) for uniformization and simplification
+ of warning messages that will be up for localization. (My bad.)
+
2005-11-10 Charles Levert <charles_levert@gna.org>
The introduction of the --only-matching and --color GNU extensions
diff --git a/src/grep.c b/src/grep.c
index 28ae71be..e63b53d7 100644
--- a/src/grep.c
+++ b/src/grep.c
@@ -1663,22 +1663,20 @@ parse_grep_colors (void)
if (val)
*(cap->var) = val;
else
- fprintf(stderr,
- _("%s: In GREP_COLORS=\"%s\", the \"%s\" capacity needs a value (\"=...\"); skipped.\n"),
- program_name, p, name);
+ error(0, 0, _("In GREP_COLORS=\"%s\", the \"%s\" capacity "
+ "needs a value (\"=...\"); skipped."), p, name);
}
else if (val)
- fprintf(stderr,
- _("%s: In GREP_COLORS=\"%s\", the \"%s\" capacity is boolean and cannot take a value (\"=%s\"); skipped.\n"),
- program_name, p, name, val);
+ error(0, 0, _("In GREP_COLORS=\"%s\", the \"%s\" capacity "
+ "is boolean and cannot take a value (\"=%s\"); "
+ "skipped."), p, name, val);
if (cap->fct)
{
const char *err_str = cap->fct();
if (err_str)
- fprintf(stderr,
- _("%s: In GREP_COLORS=\"%s\", the \"%s\" capacity %s.\n"),
- program_name, p, name, err_str);
+ error(0, 0, _("In GREP_COLORS=\"%s\", the \"%s\" capacity %s."),
+ p, name, err_str);
}
if (c == '\0')
return;
@@ -1700,9 +1698,8 @@ parse_grep_colors (void)
goto ill_formed;
ill_formed:
- fprintf(stderr,
- _("%s: Stopped processing of ill-formed GREP_COLORS=\"%s\" at remaining substring \"%s\".\n"),
- program_name, p, q);
+ error(0, 0, _("Stopped processing of ill-formed GREP_COLORS=\"%s\" "
+ "at remaining substring \"%s\"."), p, q);
}
/* mb_icase_keys() is called by main() to convert its "keys" string with
@@ -2113,10 +2110,8 @@ main (int argc, char **argv)
out_before = default_context;
if (only_matching && (out_after > 0 || out_before > 0))
{
- fprintf(stderr,
- _("%s: Any context line specification "
- "is ignored with -o/--only-matching.\n"),
- program_name);
+ error(0, 0, _("Any context line specification "
+ "is ignored with -o/--only-matching."));
out_after = out_before = 0;
}