[syslinux] [PATCH 7/9] win: Fix installing to a directory

Matt Fleming matt at console-pimps.org
Fri Nov 2 07:13:16 PDT 2012


From: Matt Fleming <matt.fleming at intel.com>

commit bda54cb68067 ("installers: Install ldlinux.c32 automatically)"
introduced a bug in the move_file() function. move_file() isn't
deleting the destination path, including the --directory argument,
that ldlinux.sys should be installed to ('new_name'), which means that
the MoveFile() calls fails. What it's actually doing is deleting
ldlinux.sys from the file destination system.

Signed-off-by: Matt Fleming <matt.fleming at intel.com>
---
 win/syslinux.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/win/syslinux.c b/win/syslinux.c
index f8e2780..64369d5 100644
--- a/win/syslinux.c
+++ b/win/syslinux.c
@@ -270,8 +270,8 @@ static void move_file(char *pathname, char *filename)
 	memcpy(cp, filename, 12);
 
 	/* Delete any previous file */
-	SetFileAttributes(pathname, FILE_ATTRIBUTE_NORMAL);
-	DeleteFile(pathname);
+	SetFileAttributes(new_name, FILE_ATTRIBUTE_NORMAL);
+	DeleteFile(new_name);
 	if (!MoveFile(pathname, new_name))
 	    SetFileAttributes(pathname, FILE_ATTRIBUTE_READONLY |
 			      FILE_ATTRIBUTE_SYSTEM |
-- 
1.7.11.7




More information about the Syslinux mailing list