aboutsummaryrefslogtreecommitdiffstats
path: root/src/path.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-10-20 22:18:12 +0200
committerMax Kellermann <max@duempel.org>2008-10-20 22:18:12 +0200
commitba96920a52bbd2208aa1f3b284edc864e26198ce (patch)
tree6750d817780ef892d82e0ce0aecaebd54546799a /src/path.c
parent99e82a2ef293429e3fcc4f6e5d8e7981b4351c7c (diff)
downloadmpd-ba96920a52bbd2208aa1f3b284edc864e26198ce.tar.gz
mpd-ba96920a52bbd2208aa1f3b284edc864e26198ce.tar.xz
mpd-ba96920a52bbd2208aa1f3b284edc864e26198ce.zip
path: replaced mpd_basename() with g_path_get_basename()
GLib's g_path_get_basename() is much more reliable than mpd_basename(). The latter could be tricked into an assertion failure.
Diffstat (limited to 'src/path.c')
-rw-r--r--src/path.c12
1 files changed, 0 insertions, 12 deletions
diff --git a/src/path.c b/src/path.c
index 159d923da..14cb34ea9 100644
--- a/src/path.c
+++ b/src/path.c
@@ -276,15 +276,3 @@ void utf8_to_fs_playlist_path(char *path_max_tmp, const char *utf8path)
rpp2app_r(path_max_tmp, path_max_tmp);
strncat(path_max_tmp, "." PLAYLIST_FILE_SUFFIX, MPD_PATH_MAX - 1);
}
-
-/* Only takes sanitized paths w/o trailing slashes */
-const char *mpd_basename(const char *path)
-{
- const char *ret = strrchr(path, '/');
-
- if (!ret)
- return path;
- ++ret;
- assert(*ret != '\0');
- return ret;
-}