Merge pull request #4041 from wayk/PathMakePathA

Fixed PathMakePathA (returned true even if it can't create the last f…
This commit is contained in:
akallabeth
2017-07-17 12:26:48 +02:00
committed by GitHub

View File

@@ -467,6 +467,7 @@ BOOL PathMakePathA(LPCSTR path, LPSECURITY_ATTRIBUTES lpAttributes)
const char delim = PathGetSeparatorA(PATH_STYLE_NATIVE);
char* dup;
char* p;
BOOL result = TRUE;
/* we only operate on a non-null, absolute path */
if (!path || *path != delim)
@@ -482,14 +483,17 @@ BOOL PathMakePathA(LPCSTR path, LPSECURITY_ATTRIBUTES lpAttributes)
if (mkdir(dup, 0777) != 0)
if (errno != EEXIST)
{
result = FALSE;
break;
}
if (p)
*p = delim;
}
free(dup);
return (p == NULL);
return (result);
#endif
}