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:
parent
b765c62f2f
commit
e0be4400cf
2
src/ls.c
2
src/ls.c
@ -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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user