From f37f50594f5be9454c4cc24f1a9541b06afd52b6 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Tue, 25 Oct 2016 12:32:23 +0200 Subject: 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 --- libfdisk/src/script.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'libfdisk') 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) -- cgit v1.2.3-55-g7522