aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar lostd <lostd@2f30.org>2014-10-10 13:22:18 +0300
committerGravatar lostd <lostd@2f30.org>2014-10-10 13:22:18 +0300
commitf05f98e4feb9a6100301800870c74365c5430ac9 (patch)
treeefe6d168f365fe0938a6072dfb189dbb700d1e0a
parent327720107565e730a15b8d16351c8c4efd34a471 (diff)
downloadnnn-f05f98e4feb9a6100301800870c74365c5430ac9.tar.gz
Another part that needs special handling for root
-rw-r--r--noice.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/noice.c b/noice.c
index d03400e..f224c96 100644
--- a/noice.c
+++ b/noice.c
@@ -468,7 +468,11 @@ nochange:
name = dents[cur].name;
- asprintf(&pathnew, "%s/%s", path, name);
+ /* Handle root case */
+ if (strcmp(path, "/") == 0)
+ asprintf(&pathnew, "/%s", name);
+ else
+ asprintf(&pathnew, "%s/%s", path, name);
DPRINTF_S(name);
DPRINTF_S(pathnew);