pathbased: fix relative path in the extlinux installer
authorAlek Du <alek.du@intel.com>
Mon, 8 Feb 2010 02:40:09 +0000 (10:40 +0800)
committerH. Peter Anvin <hpa@zytor.com>
Thu, 11 Feb 2010 00:00:52 +0000 (16:00 -0800)
Fix a bug in the extlinux installer where the relative path is not
found correctly.

Signed-off-by: Alek Du <alek.du@intel.com>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
extlinux/main.c

index 2cfb1ea..c28f190 100644 (file)
@@ -386,7 +386,7 @@ int patch_file_and_bootblock(int fd, const char *dir, int devfd)
     }
 
     subpath = strchr(dirpath, '\0');
-    while (--subpath > dirpath) {
+    while (--subpath >= dirpath) {
        if (*subpath == '/') {
            *subpath = '\0';
            if (lstat(dirpath, &xdst) || dirst.st_dev != xdst.st_dev) {