Make fn_has_ext() case insensitive by default.

committer: mfx <mfx> 980609337 +0000
This commit is contained in:
Markus F.X.J. Oberhumer
2001-01-27 15:28:57 +00:00
parent f300b31d8d
commit 34070f0b93
2 changed files with 6 additions and 3 deletions
+5 -2
View File
@@ -212,7 +212,7 @@ char *fn_basename(const char *name)
}
bool fn_has_ext(const char *name, const char *ext)
bool fn_has_ext(const char *name, const char *ext, bool ignore_case)
{
const char *n, *e;
@@ -220,7 +220,10 @@ bool fn_has_ext(const char *name, const char *ext)
for (n = e = name; *n; n++)
if (*n == '.')
e = n;
return (fn_strcmp(ext,e+1) == 0);
if (ignore_case)
return (strcasecmp(ext,e+1) == 0);
else
return (fn_strcmp(ext,e+1) == 0);
}