]> git.ipfire.org Git - thirdparty/pciutils.git/commitdiff
setpci: Pluralize 'capability' in error if needed
authorDaniel Schaefer <git@danielschaefer.me>
Tue, 16 Oct 2018 19:00:33 +0000 (21:00 +0200)
committerMartin Mares <mj@ucw.cz>
Mon, 12 Nov 2018 21:24:03 +0000 (22:24 +0100)
setpci.c

index 13b6a6b4079538334a16eb099917748541e03d8c..9f328cf1c975673b94901fec2601725b98b1e921 100644 (file)
--- a/setpci.c
+++ b/setpci.c
@@ -94,9 +94,10 @@ exec_op(struct op *op, struct pci_dev *dev)
             op->number, ((op->cap_type == PCI_CAP_NORMAL) ? "Capability" : "Extended capability"),
             op->cap_id);
       else
-        die("%s: Instance #%d of %s %04x not found - there %s only %d capability with that id.", slot,
+        die("%s: Instance #%d of %s %04x not found - there %s only %d %s with that id.", slot,
             op->number, ((op->cap_type == PCI_CAP_NORMAL) ? "Capability" : "Extended capability"),
-            op->cap_id, ((cap_nr == 1) ? "is" : "are"), cap_nr);
+            op->cap_id, ((cap_nr == 1) ? "is" : "are"), cap_nr,
+            ((cap_nr == 1) ? "capability" : "capabilities"));
 
       trace(((op->cap_type == PCI_CAP_NORMAL) ? "(cap %02x @%02x) " : "(ecap %04x @%03x) "), op->cap_id, addr);
     }