summaryrefslogtreecommitdiff
path: root/src/dd.c
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2006-08-16 19:36:46 +0000
committerPaul Eggert <eggert@cs.ucla.edu>2006-08-16 19:36:46 +0000
commitb96f5ea4925854db9eae61f98a7ec44568ecae7d (patch)
tree913918a48168b6e77f64b65f61e9d42b791f1ab2 /src/dd.c
parentf048f049e7dd531e207c630088d050c376b39feb (diff)
downloadcoreutils-b96f5ea4925854db9eae61f98a7ec44568ecae7d.tar.xz
Fix bugs when printing plurals of numbers that are not
unsigned long int values. * src/system.h (select_plural): New function. * src/md5sum.c (digest_check): Use select_plural to avoid bug. * src/uptime.c (print_uptime): Likewise. * src/dd.c (print_stats): Likewise. Also, don't use ngettext to print a floating point number, as reducing to 0 or 1 doesn't work for some languages. Instead, just use "s" for seconds since it doesn't need a plural form.
Diffstat (limited to 'src/dd.c')
-rw-r--r--src/dd.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/src/dd.c b/src/dd.c
index 577e9a08b..211c73127 100644
--- a/src/dd.c
+++ b/src/dd.c
@@ -550,7 +550,7 @@ print_stats (void)
fprintf (stderr,
ngettext ("%"PRIuMAX" truncated record\n",
"%"PRIuMAX" truncated records\n",
- MIN (r_truncate, ULONG_MAX)),
+ select_plural (r_truncate)),
r_truncate);
if (status_flags & STATUS_NOXFER)
@@ -562,7 +562,7 @@ print_stats (void)
fprintf (stderr,
ngettext ("%"PRIuMAX" byte (%s) copied",
"%"PRIuMAX" bytes (%s) copied",
- MIN (w_bytes, ULONG_MAX)),
+ select_plural (w_bytes)),
w_bytes,
human_readable (w_bytes, hbuf, human_opts, 1, 1));
@@ -581,10 +581,17 @@ print_stats (void)
bytes_per_second = _("Infinity B");
}
- fprintf (stderr,
- ngettext (", %g second, %s/s\n",
- ", %g seconds, %s/s\n", delta_s == 1),
- delta_s, bytes_per_second);
+ /* TRANSLATORS: The two instances of "s" in this string are the SI
+ symbol "s" (meaning second), and should not be translated.
+
+ This format used to be:
+
+ ngettext (", %g second, %s/s\n", ", %g seconds, %s/s\n", delta_s == 1)
+
+ but that was incorrect for languages like Polish. To fix this
+ bug we now use SI symbols even though they're a bit more
+ confusing in English. */
+ fprintf (stderr, _(", %g s, %s/s\n"), delta_s, bytes_per_second);
}
static void