diff options
author | Max Kellermann <max@duempel.org> | 2008-10-20 22:18:40 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2008-10-20 22:18:40 +0200 |
commit | 49260e6db20aa865e485a02fae5c0249d1df0d8a (patch) | |
tree | 03446e4b7e117e87d048d2e36ad199b68cefe752 /src/path.c | |
parent | ba96920a52bbd2208aa1f3b284edc864e26198ce (diff) | |
download | mpd-49260e6db20aa865e485a02fae5c0249d1df0d8a.tar.gz mpd-49260e6db20aa865e485a02fae5c0249d1df0d8a.tar.xz mpd-49260e6db20aa865e485a02fae5c0249d1df0d8a.zip |
path: replaced parent_path() with g_path_get_dirname()
Again, GLib's version is more robust than ours.
Diffstat (limited to '')
-rw-r--r-- | src/path.c | 28 |
1 files changed, 0 insertions, 28 deletions
diff --git a/src/path.c b/src/path.c index 14cb34ea9..5398c7f1a 100644 --- a/src/path.c +++ b/src/path.c @@ -202,34 +202,6 @@ void pathcpy_trunc(char *dest, const char *src) dest[len] = '\0'; } -char *parent_path(char *path_max_tmp, const char *path) -{ - char *c; - static const int handle_trailing_slashes = 0; - - pathcpy_trunc(path_max_tmp, path); - - if (handle_trailing_slashes) { - size_t last_char = strlen(path_max_tmp) - 1; - - while (last_char > 0 && path_max_tmp[last_char] == '/') - path_max_tmp[last_char--] = '\0'; - } - - c = strrchr(path_max_tmp,'/'); - - if (c == NULL) - path_max_tmp[0] = '\0'; - else { - /* strip redundant slashes: */ - while ((path_max_tmp <= c) && *(--c) == '/') /* nothing */ - ; - c[1] = '\0'; - } - - return path_max_tmp; -} - char *sanitizePathDup(const char *path) { int len = strlen(path) + 1; |