diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2006-08-16 19:36:46 +0000 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2006-08-16 19:36:46 +0000 |
commit | b96f5ea4925854db9eae61f98a7ec44568ecae7d (patch) | |
tree | 913918a48168b6e77f64b65f61e9d42b791f1ab2 /src/uptime.c | |
parent | f048f049e7dd531e207c630088d050c376b39feb (diff) | |
download | coreutils-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/uptime.c')
-rw-r--r-- | src/uptime.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/uptime.c b/src/uptime.c index da8618e28..bd2b0ec95 100644 --- a/src/uptime.c +++ b/src/uptime.c @@ -125,7 +125,8 @@ print_uptime (size_t n, const STRUCT_UTMP *this) else { if (0 < updays) - printf (ngettext ("%ld day", "%ld days", updays), updays); + printf (ngettext ("%ld day", "%ld days", select_plural (updays)), + updays); printf (" %2d:%02d, ", uphours, upmins); } printf (ngettext ("%lu user", "%lu users", entries), |