Commit edda4637 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

cabinet: Make sure that parent directories exist when creating a new directory.

parent 6b955b51
......@@ -237,7 +237,18 @@ static INT_PTR fdi_notify_extract(FDINOTIFICATIONTYPE fdint, PFDINOTIFICATION pf
/* create the destination directory if it doesn't exist */
if (GetFileAttributesA(szDirectory) == INVALID_FILE_ATTRIBUTES)
{
char *ptr;
for(ptr = szDirectory + strlen(pDestination->Destination)+1; *ptr; ptr++) {
if(*ptr == '\\') {
*ptr = 0;
CreateDirectoryA(szDirectory, NULL);
*ptr = '\\';
}
}
CreateDirectoryA(szDirectory, NULL);
}
hFile = CreateFileA(szFullPath, GENERIC_READ | GENERIC_WRITE, 0, NULL,
CREATE_NEW, FILE_ATTRIBUTE_NORMAL, NULL);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment