lsblk: fix -T optional argument

Addresses: https://github.com/karelzak/util-linux/issues/1132
Signed-off-by: Karel Zak <kzak@redhat.com>
This commit is contained in:
Karel Zak 2020-09-02 11:10:18 +02:00
parent 42fa381b9d
commit 6932a11035
1 changed files with 5 additions and 2 deletions

View 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;