mirror of
https://github.com/facebook/zstd.git
synced 2025-08-07 06:23:00 +03:00
Added check to perform comparison only if extension is present
This commit is contained in:
@@ -334,13 +334,16 @@ 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);
|
||||||
while(*extensionList!=NULL)
|
if(strcmp(ext,""))
|
||||||
{
|
{
|
||||||
const char* isCompressedExtension = strstr(ext,*extensionList);
|
while(*extensionList!=NULL)
|
||||||
if(isCompressedExtension)
|
{
|
||||||
return 1;
|
const char* isCompressedExtension = strstr(ext,*extensionList);
|
||||||
++extensionList;
|
if(isCompressedExtension)
|
||||||
}
|
return 1;
|
||||||
|
++extensionList;
|
||||||
|
}
|
||||||
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user