diff options
-rw-r--r-- | lib/canonicalize.c | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/lib/canonicalize.c b/lib/canonicalize.c index fd18af42c..ab32c1043 100644 --- a/lib/canonicalize.c +++ b/lib/canonicalize.c @@ -174,16 +174,9 @@ canonicalize_path(const char *path) if (path == NULL) return NULL; - if (!myrealpath(path, canonical, PATH_MAX+1)) { - char *res = strdup(path); - if (res) { - p = strrchr(res, '/'); - /* delete trailing slash */ - if (p && p > res && *(p + 1) == '\0') - *p = '\0'; - } - return res; - } + if (!myrealpath(path, canonical, PATH_MAX+1)) + return strdup(path); + p = strrchr(canonical, '/'); if (p && strncmp(p, "/dm-", 4) == 0 && isdigit(*(p + 4))) { |