aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-12-16 21:22:08 +0100
committerMax Kellermann <max@duempel.org>2008-12-16 21:22:08 +0100
commite0be4400cf22a3bcb2a976a6b3d58183c0155b52 (patch)
tree5e5165a04ae0232e06e554f84dab78446826eb54
parentb765c62f2f4fdec585e1372765c4c4a076b9154c (diff)
downloadmpd-e0be4400cf22a3bcb2a976a6b3d58183c0155b52.tar.gz
mpd-e0be4400cf22a3bcb2a976a6b3d58183c0155b52.tar.xz
mpd-e0be4400cf22a3bcb2a976a6b3d58183c0155b52.zip
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).
-rw-r--r--src/ls.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/ls.c b/src/ls.c
index 65692dc1f..27962ad91 100644
--- a/src/ls.c
+++ b/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;
}