]> diplodocus.org Git - nmh/commitdiff
uip/folder.c: Rewrite plural test to common form.
authorRalph Corderoy <ralph@inputplus.co.uk>
Sat, 13 May 2017 17:39:06 +0000 (18:39 +0100)
committerRalph Corderoy <ralph@inputplus.co.uk>
Sat, 13 May 2017 17:39:06 +0000 (18:39 +0100)
The common form is a choice between "" and "s".  This one occurrence was
using " " and "s" so either output was a fixed width.  Alter the
printf(3) format string from `%s' to `%1s' to provide that instead.
Allows the new code to be altered by an upcoming `plural' change.

uip/folder.c

index 23aea0b740adde862fe64c9f4beb6474d53c573f..68e9182dddf95f154d3420dd3f028a823f4cace9 100644 (file)
@@ -568,9 +568,9 @@ print_folders (void)
                        nummsgdigits, "no",
                        fi[i].others ? lowmsgdigits + hghmsgdigits + 5 : 0, "");
            } else {
                        nummsgdigits, "no",
                        fi[i].others ? lowmsgdigits + hghmsgdigits + 5 : 0, "");
            } else {
-               printf ("has %*d message%s  (%*d-%*d)",
+               printf ("has %*d message%1s  (%*d-%*d)",
                        nummsgdigits, fi[i].nummsg,
                        nummsgdigits, fi[i].nummsg,
-                       (fi[i].nummsg == 1) ? " " : "s",
+                       (fi[i].nummsg == 1) ? "" : "s",
                        lowmsgdigits, fi[i].lowmsg,
                        hghmsgdigits, fi[i].hghmsg);
                if (fi[i].curmsg >= fi[i].lowmsg && fi[i].curmsg <= fi[i].hghmsg) {
                        lowmsgdigits, fi[i].lowmsg,
                        hghmsgdigits, fi[i].hghmsg);
                if (fi[i].curmsg >= fi[i].lowmsg && fi[i].curmsg <= fi[i].hghmsg) {