aboutsummaryrefslogtreecommitdiffstats
path: root/src/path.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-10-31 16:50:51 +0100
committerMax Kellermann <max@duempel.org>2008-10-31 16:50:51 +0100
commit9fdac529b4eae2e8093db8308fcf95d270b2bfa7 (patch)
treebd1f3004004877a1168a9cdbdf975dba57aa29a8 /src/path.c
parentf291876772d1283433924518f87e639e17901a17 (diff)
downloadmpd-9fdac529b4eae2e8093db8308fcf95d270b2bfa7.tar.gz
mpd-9fdac529b4eae2e8093db8308fcf95d270b2bfa7.tar.xz
mpd-9fdac529b4eae2e8093db8308fcf95d270b2bfa7.zip
path: removed sanitizePathDup()
We don't need to sanitize the path, because the mapper already checks for malformed paths.
Diffstat (limited to '')
-rw-r--r--src/path.c40
1 files changed, 0 insertions, 40 deletions
diff --git a/src/path.c b/src/path.c
index 62a2362b5..f241fce8c 100644
--- a/src/path.c
+++ b/src/path.c
@@ -168,43 +168,3 @@ char *pfx_dir(char *dst,
/* this is weird, but directory.c can use it more safely/efficiently */
return (dst + pfx_len + 1);
}
-
-char *sanitizePathDup(const char *path)
-{
- int len = strlen(path) + 1;
- char *ret = xmalloc(len);
- char *cp = ret;
-
- memset(ret, 0, len);
-
- len = 0;
-
- /* eliminate more than one '/' in a row, like "///" */
- while (*path) {
- while (*path == '/')
- path++;
- if (*path == '.') {
- /* we don't want to have hidden directories, or '.' or
- ".." in our path */
- free(ret);
- return NULL;
- }
- while (*path && *path != '/') {
- *(cp++) = *(path++);
- len++;
- }
- if (*path == '/') {
- *(cp++) = *(path++);
- len++;
- }
- }
-
- if (len && ret[len - 1] == '/') {
- len--;
- ret[len] = '\0';
- }
-
- DEBUG("sanitized: %s\n", ret);
-
- return xrealloc(ret, len + 1);
-}