Workaround: Error parsing line of "/proc/partitions"
authorshort <>
Sun, 5 Oct 2003 13:35:29 +0000 (13:35 +0000)
committershort <>
Sun, 5 Oct 2003 13:35:29 +0000 (13:35 +0000)
 - Bugreport by the courtesy of Karel Zatloukal and Jesse Glick.

src/install/libcaptive-install/proc_partitions.c

index 59a9a80..75508f7 100644 (file)
@@ -86,6 +86,12 @@ ntfs_volume *volume;
                lineno++;
                if (lineno<=2)
                        continue;
+               if (!*line || *line=='\n') {
+                       /* At least RedHat Linux kernel 2.4.18-18.8.0 sometimes appends
+                        * bogus empty line at the end of file.
+                        */
+                       continue;
+                       }
                if (4!=sscanf(line,"%u%u%llu%100s",&major,&minor,&blocks,device+strlen("/dev/")))
                        g_error(_("Error parsing line of \"%s\": %s"),FILENAME_PROC_PARTITIONS,line);
                memcpy(device,"/dev/",strlen("/dev/"));