mirror of
https://github.com/facebook/zstd.git
synced 2025-08-05 19:15:58 +03:00
Added check to perform comparison only if extension is present
This commit is contained in:
@@ -334,6 +334,8 @@ NO => return 0
|
|||||||
int UTIL_isCompressedFile(const char *inputName, const char *extensionList[])
|
int UTIL_isCompressedFile(const char *inputName, const char *extensionList[])
|
||||||
{
|
{
|
||||||
const char* ext = UTIL_getFileExtension(inputName);
|
const char* ext = UTIL_getFileExtension(inputName);
|
||||||
|
if(strcmp(ext,""))
|
||||||
|
{
|
||||||
while(*extensionList!=NULL)
|
while(*extensionList!=NULL)
|
||||||
{
|
{
|
||||||
const char* isCompressedExtension = strstr(ext,*extensionList);
|
const char* isCompressedExtension = strstr(ext,*extensionList);
|
||||||
@@ -341,6 +343,7 @@ int UTIL_isCompressedFile(const char *inputName, const char *extensionList[])
|
|||||||
return 1;
|
return 1;
|
||||||
++extensionList;
|
++extensionList;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user