]> Sergey Matveev's repositories - nnn.git/commitdiff
Another part that needs special handling for root
authorlostd <lostd@2f30.org>
Fri, 10 Oct 2014 10:22:18 +0000 (13:22 +0300)
committerlostd <lostd@2f30.org>
Fri, 10 Oct 2014 10:22:18 +0000 (13:22 +0300)
noice.c

diff --git a/noice.c b/noice.c
index d03400e984d06cf8b10ad14179d774d438701413..f224c964982af9897072021776757476deeff462 100644 (file)
--- 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);