ls: don't return suffix from parent directory name

When a file had no file name extension, getSuffix() could return the
extension of the parent directory (if it had one).
This commit is contained in:
Max Kellermann 2008-12-16 21:22:08 +01:00
parent b765c62f2f
commit e0be4400cf

View File

@ -59,7 +59,7 @@ bool isRemoteUrl(const char *url)
/* suffixes should be ascii only characters */
const char *getSuffix(const char *utf8file)
{
const char *dot = strrchr(utf8file, '.');
const char *dot = strrchr(g_basename(utf8file), '.');
return dot != NULL ? dot + 1 : NULL;
}