com_select(): Improve message.
authorAndre Noll <maan@tuebingen.mpg.de>
Wed, 10 Oct 2018 18:12:28 +0000 (20:12 +0200)
committerAndre Noll <maan@tuebingen.mpg.de>
Tue, 25 Dec 2018 18:30:50 +0000 (19:30 +0100)
Let's be gramatically correct and omit the plural "s" if there is
only one admissible file.

afs.c

diff --git a/afs.c b/afs.c
index 4fe2140..d9cddeb 100644 (file)
--- a/afs.c
+++ b/afs.c
@@ -589,8 +589,9 @@ static int com_select_callback(struct afs_callback_arg *aca)
        para_printf(&aca->pbout, "activating dummy mood\n");
        activate_mood_or_playlist(NULL, &num_admissible, NULL);
 out:
        para_printf(&aca->pbout, "activating dummy mood\n");
        activate_mood_or_playlist(NULL, &num_admissible, NULL);
 out:
-       para_printf(&aca->pbout, "activated %s (%d admissible files)\n",
-               current_mop? current_mop : "dummy mood", num_admissible);
+       para_printf(&aca->pbout, "activated %s (%d admissible file%s)\n",
+               current_mop? current_mop : "dummy mood", num_admissible,
+                       num_admissible == 1? "" : "s");
 free_lpr:
        lls_free_parse_result(aca->lpr, cmd);
        return ret;
 free_lpr:
        lls_free_parse_result(aca->lpr, cmd);
        return ret;