Commit e0be4400 authored by Max Kellermann's avatar Max Kellermann

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).
parent b765c62f
......@@ -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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment