From 06ed8219fd9e7e689626e7e6f250d94efb58af59 Mon Sep 17 00:00:00 2001 From: short <> Date: Sun, 5 Oct 2003 13:35:29 +0000 Subject: [PATCH] Workaround: Error parsing line of "/proc/partitions" - Bugreport by the courtesy of Karel Zatloukal and Jesse Glick. --- src/install/libcaptive-install/proc_partitions.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/install/libcaptive-install/proc_partitions.c b/src/install/libcaptive-install/proc_partitions.c index 59a9a80..75508f7 100644 --- a/src/install/libcaptive-install/proc_partitions.c +++ b/src/install/libcaptive-install/proc_partitions.c @@ -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/")); -- 1.8.3.1