summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2012-01-02 02:16:14 -0800
committerPaul Eggert <eggert@cs.ucla.edu>2012-01-02 02:16:27 -0800
commit4c6a1dcd647b208a59e3b23ad0aaf0a25397f6ad (patch)
tree0b9df55a9b574c18aff7962366d26236f2cda1a2
parent75bc6fb14dea81ade7d761448610c2280d17d1d6 (diff)
downloadgrep-4c6a1dcd647b208a59e3b23ad0aaf0a25397f6ad.tar.gz
grep: prefer fgets to printf, _ to gettext
* lib/colorize.h (print_end_colorize): * lib/ms/colorize-impl.c (print_end_colorize): Use fputs instead of printf. * src/main.c (usage): Likewise. Use _ instead of gettext.
-rw-r--r--lib/colorize.h2
-rw-r--r--lib/ms/colorize-impl.c2
-rw-r--r--src/main.c4
3 files changed, 4 insertions, 4 deletions
diff --git a/lib/colorize.h b/lib/colorize.h
index 7890fbc8..104f7a03 100644
--- a/lib/colorize.h
+++ b/lib/colorize.h
@@ -33,5 +33,5 @@ print_start_colorize (char const *sgr_start, char const *sgr_seq)
static inline void
print_end_colorize (char const *sgr_end)
{
- printf ("%s", sgr_end);
+ fputs (sgr_end, stdout);
}
diff --git a/lib/ms/colorize-impl.c b/lib/ms/colorize-impl.c
index 3c8c73ab..d9d9b959 100644
--- a/lib/ms/colorize-impl.c
+++ b/lib/ms/colorize-impl.c
@@ -212,5 +212,5 @@ print_end_colorize (char const *sgr_end)
w32_clreol ();
}
else
- printf ("%s", sgr_end);
+ fputs (sgr_end, stdout);
}
diff --git a/src/main.c b/src/main.c
index 3376fa46..a1d590a2 100644
--- a/src/main.c
+++ b/src/main.c
@@ -1426,7 +1426,7 @@ usage (int status)
printf (_("Usage: %s [OPTION]... PATTERN [FILE]...\n"), program_name);
printf (_("\
Search for PATTERN in each FILE or standard input.\n"));
- printf ("%s", gettext (before_options));
+ fputs (_(before_options), stdout);
printf (_("\
Example: %s -i 'hello world' menu.h main.c\n\
\n\
@@ -1507,7 +1507,7 @@ Context control:\n\
-u, --unix-byte-offsets report offsets as if CRs were not there\n\
(MSDOS/Windows)\n\
\n"));
- printf ("%s", _(after_options));
+ fputs (_(after_options), stdout);
printf (_("\
With no FILE, or when FILE is -, read standard input. If less than two FILEs\n\
are given, assume -h. Exit status is 0 if any line was selected, 1 otherwise;\n\