diff options
author | Matt Fleming <matt.fleming@intel.com> | 2012-11-01 11:12:03 +0000 |
---|---|---|
committer | Matt Fleming <matt.fleming@intel.com> | 2012-11-02 14:06:20 +0000 |
commit | b5d5717baa264897425a4bdd8f64ac393756f64a (patch) | |
tree | 53fe24f233927003fbbb04ae7263f1d8ac4500dd | |
parent | c7381a5cef7f38e0176b8bc90e7ca54c4d0711d2 (diff) | |
download | syslinux-b5d5717baa264897425a4bdd8f64ac393756f64a.tar.gz syslinux-b5d5717baa264897425a4bdd8f64ac393756f64a.tar.xz syslinux-b5d5717baa264897425a4bdd8f64ac393756f64a.zip |
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@intel.com>
-rw-r--r-- | win/syslinux.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/win/syslinux.c b/win/syslinux.c index f8e27801..64369d5c 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 | |