]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
lsirq: improve --sort IRQ
authorKarel Zak <kzak@redhat.com>
Fri, 29 Apr 2022 08:11:49 +0000 (10:11 +0200)
committerKarel Zak <kzak@redhat.com>
Fri, 29 Apr 2022 08:11:49 +0000 (10:11 +0200)
IRQ column mixes numbers and text, it seems better to use strverscmp()
rather than classic strcmp().

Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=2078787
Signed-off-by: Karel Zak <kzak@redhat.com>
sys-utils/irq-common.c

index 1bdcfad3168aa62d4d7ec71c11cadfb8e600d812..ded708c3e9e61dad5027c2b0488f0c736592a561 100644 (file)
@@ -384,7 +384,7 @@ static inline int cmp_delta(const struct irq_info *a,
 static inline int cmp_interrupts(const struct irq_info *a,
                           const struct irq_info *b)
 {
-       return (strcmp(a->irq, b->irq) > 0) ? 1 : 0;
+       return (strverscmp(a->irq, b->irq) > 0) ? 1 : 0;
 }
 
 static void sort_result(struct irq_output *out,