match full mtd partition names
[project/fstools.git] / libfstools / mtd.c
index 00bb2d6a549398cef21b315493fedd8485e9fc62..b9daabcb595e75cd4cd12f9757729b55257e2e77 100644 (file)
@@ -130,7 +130,9 @@ static char* mtd_find_index(char *name)
                return index;
 
        while (!index && fgets(line, sizeof(line), fp)) {
                return index;
 
        while (!index && fgets(line, sizeof(line), fp)) {
-               if (strstr(line, name)) {
+               char *ret;
+
+               if ((ret = strstr(line, name)) && (ret[strlen(name)] == '"')) {
                        char *eol = strstr(line, ":");
 
                        if (!eol)
                        char *eol = strstr(line, ":");
 
                        if (!eol)