Browse Source

Review IsFileExtension() to be case-insensitive

pull/1060/head
Ray 5 years ago
parent
commit
358ca7595d
1 changed files with 5 additions and 1 deletions
  1. +5
    -1
      src/core.c

+ 5
- 1
src/core.c View File

@ -1829,10 +1829,14 @@ bool FileExists(const char *fileName)
}
// Check file extension
// NOTE: Extensions checking is not case-sensitive
bool IsFileExtension(const char *fileName, const char *ext)
{
bool result = false;
const char *fileExt = GetExtension(fileName);
char fileExtLower[16] = { 0 };
strcpy(fileExtLower, TextToLower(fileExt));
if (fileExt != NULL)
{
@ -1841,7 +1845,7 @@ bool IsFileExtension(const char *fileName, const char *ext)
for (int i = 0; i < extCount; i++)
{
if (strcmp(fileExt, checkExts[i] + 1) == 0)
if (TextIsEqual(fileExtLower, TextToLower(checkExts[i] + 1)))
{
result = true;
break;

Loading…
Cancel
Save