[syslinux:elflink] win: Fix installing to a directory

syslinux-bot for Matt Fleming matt.fleming at intel.com
Mon Nov 5 08:03:08 PST 2012

Commit-ID:  b5d5717baa264897425a4bdd8f64ac393756f64a
Gitweb:     http://www.syslinux.org/commit/b5d5717baa264897425a4bdd8f64ac393756f64a
Author:     Matt Fleming <matt.fleming at intel.com>
AuthorDate: Thu, 1 Nov 2012 11:12:03 +0000
Committer:  Matt Fleming <matt.fleming at intel.com>
CommitDate: Fri, 2 Nov 2012 14:06:20 +0000

win: Fix installing to a directory

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 files 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 |

More information about the Syslinux-commits mailing list