Added check to perform comparison only if extension is present

This commit is contained in:
Shashank Tavildar 2019-10-29 12:56:04 -07:00
parent 9ab6a747d4
commit c5060997e9

View File

@ -334,13 +334,16 @@ NO => return 0
int UTIL_isCompressedFile(const char *inputName, const char *extensionList[])
{
const char* ext = UTIL_getFileExtension(inputName);
while(*extensionList!=NULL)
{
const char* isCompressedExtension = strstr(ext,*extensionList);
if(isCompressedExtension)
return 1;
++extensionList;
}
if(strcmp(ext,""))
{
while(*extensionList!=NULL)
{
const char* isCompressedExtension = strstr(ext,*extensionList);
if(isCompressedExtension)
return 1;
++extensionList;
}
}
return 0;
}