X-Git-Url: https://wimlib.net/git/?p=wimlib;a=blobdiff_plain;f=src%2Fwin32_apply.c;h=972224efad978188b191c217508fe734ba2fd2a8;hp=11104f24bc88404d2ba2b5cbc94b8a1b593fa140;hb=d5447ec541b245fa91dac72ce2822bdaafc30f6c;hpb=b81519a7676f43fc26b2287b2d033711c22e4e99 diff --git a/src/win32_apply.c b/src/win32_apply.c index 11104f24..972224ef 100644 --- a/src/win32_apply.c +++ b/src/win32_apply.c @@ -601,18 +601,19 @@ win32_begin_extract_unnamed_stream(const struct wim_inode *inode, /* Directories must be created with CreateDirectoryW(). Then the call * to CreateFileW() will merely open the directory that was already * created rather than creating a new file. */ - if (inode->i_attributes & FILE_ATTRIBUTE_DIRECTORY && - !path_is_root_of_drive(path)) { - if (!CreateDirectoryW(path, NULL)) { - err = GetLastError(); - if (err != ERROR_ALREADY_EXISTS) { - ERROR("Failed to create directory \"%ls\"", - path); - win32_error(err); - return WIMLIB_ERR_MKDIR; + if (inode->i_attributes & FILE_ATTRIBUTE_DIRECTORY) { + if (!path_is_root_of_drive(path)) { + if (!CreateDirectoryW(path, NULL)) { + err = GetLastError(); + if (err != ERROR_ALREADY_EXISTS) { + ERROR("Failed to create directory \"%ls\"", + path); + win32_error(err); + return WIMLIB_ERR_MKDIR; + } } + DEBUG("Created directory \"%ls\"", path); } - DEBUG("Created directory \"%ls\"", path); *creationDisposition_ret = OPEN_EXISTING; } if (inode->i_attributes & FILE_ATTRIBUTE_ENCRYPTED &&