diff options
author | Karel Zak | 2016-10-25 12:32:23 +0200 |
---|---|---|
committer | Karel Zak | 2016-10-25 12:32:23 +0200 |
commit | f37f50594f5be9454c4cc24f1a9541b06afd52b6 (patch) | |
tree | 6c9722dbedc2e38b9f12e9534b1456881f4ed7fa /libfdisk | |
parent | tests: add GPT attributes parser tests (diff) | |
download | kernel-qcow2-util-linux-f37f50594f5be9454c4cc24f1a9541b06afd52b6.tar.gz kernel-qcow2-util-linux-f37f50594f5be9454c4cc24f1a9541b06afd52b6.tar.xz kernel-qcow2-util-linux-f37f50594f5be9454c4cc24f1a9541b06afd52b6.zip |
libfdisk: fix script Type= and Id= parsing
The parser is not consistent and *case insensitive* Type= and Id= tokens
are not expected on all places.
Addresses: https://github.com/karelzak/util-linux/issues/367
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'libfdisk')
-rw-r--r-- | libfdisk/src/script.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/libfdisk/src/script.c b/libfdisk/src/script.c index 0d89fdaf1..4c1f9c7b9 100644 --- a/libfdisk/src/script.c +++ b/libfdisk/src/script.c @@ -904,11 +904,10 @@ static int parse_line_nameval(struct fdisk_script *dp, char *s) rc = next_string(&p, &pa->name); } else if (!strncasecmp(p, "type=", 5) || - !strncasecmp(p, "Id=", 3)) { /* backward compatibility */ char *type; - p += (*p == 'I' ? 3 : 5); /* "Id=" or "type=" */ + p += ((*p == 'I' || *p == 'i') ? 3 : 5); /* "Id=", "type=" */ rc = next_string(&p, &type); if (rc) |