forked from old/legacy-imlib2
__imlib_FileExtension: Use basename if there are no dots
This commit is contained in:
parent
ac41eae7fa
commit
c913f97285
|
@ -103,12 +103,17 @@ __imlib_FileRealFile(const char *file)
|
||||||
const char *
|
const char *
|
||||||
__imlib_FileExtension(const char *file)
|
__imlib_FileExtension(const char *file)
|
||||||
{
|
{
|
||||||
const char *p;
|
const char *p, *s;
|
||||||
|
int ch;
|
||||||
|
|
||||||
p = strrchr(file, '.');
|
if (!file)
|
||||||
if (!p)
|
|
||||||
return NULL;
|
return NULL;
|
||||||
p++;
|
|
||||||
|
for (p = s = file; (ch = *s) != 0; s++)
|
||||||
|
{
|
||||||
|
if (ch == '.' || ch == '/')
|
||||||
|
p = s + 1;
|
||||||
|
}
|
||||||
return *p != '\0' ? p : NULL;
|
return *p != '\0' ? p : NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue