>From 4e00ae1354aa80baebf5ac3d2e1efc2c2a779ef3 Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Wed, 20 Aug 2008 22:24:38 +0200 Subject: [PATCH] md5sum: avoid possible double singular/plural in warning messages In many languages in "N out of M files failed" not only "files" needs to be singular or plural depending on M, but also "failed" needs a singular or plural form depending on N. Avoid this complication and only say how many files failed; the total number of files is not really interesting anyway and only makes the message less clear. --- src/md5sum.c | 26 +++++++++----------------- 1 files changed, 9 insertions(+), 17 deletions(-) diff --git a/src/md5sum.c b/src/md5sum.c index 238c02e..8bdbe97 100644 --- a/src/md5sum.c +++ b/src/md5sum.c @@ -570,25 +570,17 @@ digest_check (const char *checkfile_name) { if (n_open_or_read_failures != 0) error (0, 0, - ngettext ("WARNING: %" PRIuMAX " of %" PRIuMAX - " listed file could not be read", - "WARNING: %" PRIuMAX " of %" PRIuMAX - " listed files could not be read", - select_plural (n_properly_formatted_lines)), - n_open_or_read_failures, n_properly_formatted_lines); + ngettext ("WARNING: %" PRIuMAX " file could not be read", + "WARNING: %" PRIuMAX " files could not be read", + select_plural (n_open_or_read_failures)), + n_open_or_read_failures); if (n_mismatched_checksums != 0) - { - uintmax_t n_computed_checksums = - (n_properly_formatted_lines - n_open_or_read_failures); - error (0, 0, - ngettext ("WARNING: %" PRIuMAX " of %" PRIuMAX - " computed checksum did NOT match", - "WARNING: %" PRIuMAX " of %" PRIuMAX - " computed checksums did NOT match", - select_plural (n_computed_checksums)), - n_mismatched_checksums, n_computed_checksums); - } + error (0, 0, + ngettext ("WARNING: %" PRIuMAX " checksum did NOT match", + "WARNING: %" PRIuMAX " checksums did NOT match", + select_plural (n_mismatched_checksums)), + n_mismatched_checksums); } } -- 1.5.6.4