remount: parse the fstab allowing for tab as well as space
authorAlan Cox <alan@linux.intel.com>
Sun, 12 Nov 2017 21:05:33 +0000 (21:05 +0000)
committerAlan Cox <alan@linux.intel.com>
Sun, 12 Nov 2017 21:05:33 +0000 (21:05 +0000)
Applications/util/remount.c

index ed7ff00..9a9ad3c 100644 (file)
@@ -16,8 +16,8 @@ char *getdev(char *arg)
        f = fopen("/etc/mtab", "r");
        if (f) {
                while (fgets(tmp, sizeof(tmp), f)) {
-                       dev = strtok(tmp, " ");
-                       mntpt = strtok(NULL, " ");
+                       dev = strtok(tmp, " \t");
+                       mntpt = strtok(NULL, " \t");
                        if ((strcmp(dev, arg) == 0) || (strcmp(mntpt, arg) == 0)) {
                                fclose(f);
                                return strdup(dev);