]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
libmount: (tests) fix --filesystems test argument parsing
authorThomas Weißschuh <thomas@t-8ch.de>
Sun, 24 Dec 2023 12:04:59 +0000 (13:04 +0100)
committerThomas Weißschuh <thomas@t-8ch.de>
Sun, 31 Dec 2023 12:06:02 +0000 (13:06 +0100)
Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
libmount/src/utils.c

index 2677b18dc01f54822a185c62ebc0dc16c5e1cf84..b6d95696adf7f277bbe614a8f52874222d53fd22 100644 (file)
@@ -1360,11 +1360,10 @@ static int test_filesystems(struct libmnt_test *ts __attribute__((unused)),
        char **filesystems = NULL;
        int rc;
 
-       if (argc != 2)
+       if (argc != 1 && argc != 2)
                return -1;
 
-
-       rc = mnt_get_filesystems(&filesystems, argc ? argv[1] : NULL);
+       rc = mnt_get_filesystems(&filesystems, argc == 2 ? argv[1] : NULL);
        if (!rc) {
                char **p;
                for (p = filesystems; *p; p++)