mirror of
https://github.com/morgan9e/FreeRDP
synced 2026-04-15 00:44:19 +09:00
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:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user