]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
lsblk: fix -T optional argument
authorKarel Zak <kzak@redhat.com>
Wed, 2 Sep 2020 09:10:18 +0000 (11:10 +0200)
committerKarel Zak <kzak@redhat.com>
Wed, 2 Sep 2020 09:10:18 +0000 (11:10 +0200)
Addresses: https://github.com/karelzak/util-linux/issues/1132
Signed-off-by: Karel Zak <kzak@redhat.com>
misc-utils/lsblk.c

index 1ec709019c9b31fb31099406e8e6277b8ddf1ff9..7a48adbe431c316409090f6f9f1bd4130e0413e6 100644 (file)
@@ -1888,7 +1888,7 @@ int main(int argc, char *argv[])
        lsblk_init_debug();
 
        while((c = getopt_long(argc, argv,
-                              "abdDzE:e:fhJlnMmo:OpPiI:rstVST:x:", longopts, NULL)) != -1) {
+                              "abdDzE:e:fhJlnMmo:OpPiI:rstVST::x:", longopts, NULL)) != -1) {
 
                err_exclusive_options(c, longopts, excl, excl_st);
 
@@ -1999,8 +1999,11 @@ int main(int argc, char *argv[])
                        break;
                case 'T':
                        force_tree = 1;
-                       if (optarg)
+                       if (optarg) {
+                               if (*optarg == '=')
+                                       optarg++;
                                lsblk->tree_id = column_name_to_id(optarg, strlen(optarg));
+                       }
                        break;
                case OPT_SYSROOT:
                        lsblk->sysroot = optarg;