Update archive_file_7z.c

This commit is contained in:
bparker06 2018-01-02 20:24:48 -05:00 committed by GitHub
parent 54e7ec8e79
commit c51b107d9c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -370,18 +370,21 @@ static int sevenzip_parse_file_init(file_archive_transfer_t *state,
if (InFile_Open(&sevenzip_context->archiveStream.file, file))
goto error;
#else
fileW = utf8_to_utf16_string_alloc(file);
if (fileW)
if (!string_is_empty(file))
{
/* could not open 7zip archive? */
if (InFile_OpenW(&sevenzip_context->archiveStream.file, fileW))
{
free(fileW);
goto error;
}
fileW = utf8_to_utf16_string_alloc(file);
free(fileW);
if (fileW)
{
/* could not open 7zip archive? */
if (InFile_OpenW(&sevenzip_context->archiveStream.file, fileW))
{
free(fileW);
goto error;
}
free(fileW);
}
}
#endif