From 47090922dcaa099064e02237a442143814b6a5ae Mon Sep 17 00:00:00 2001 From: kichik Date: Fri, 8 Apr 2005 15:29:52 +0000 Subject: [PATCH] fixed bug #1119442 - CreateDirectory sets error flag with paths containing "\\" git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@3956 212acab6-be3b-0410-9dea-997c60f758d6 --- Source/exehead/exec.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/Source/exehead/exec.c b/Source/exehead/exec.c index 7505da3d..8860865a 100644 --- a/Source/exehead/exec.c +++ b/Source/exehead/exec.c @@ -287,16 +287,20 @@ static int NSISCALL ExecuteEntry(entry *entry_) { while (c) { - WIN32_FIND_DATA *fd; p = findchar(p, '\\'); - c=*p; - *p=0; - fd = file_exists(buf1); - if (!fd) { - if (!CreateDirectory(buf1,NULL)) + c = *p; + *p = 0; + if (!CreateDirectory(buf1, NULL)) + { + if (GetLastError() != ERROR_ALREADY_EXISTS) + { exec_error++; + } + else if ((GetFileAttributes(buf1) & FILE_ATTRIBUTE_DIRECTORY) == 0) + { + exec_error++; + } } - else if ((fd->dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) == 0) exec_error++; *p++ = c; } }