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
This commit is contained in:
kichik 2005-04-08 15:29:52 +00:00
parent 0856e2a3c4
commit 47090922dc

View file

@ -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;
}
}