From: lostd Date: Fri, 10 Oct 2014 10:22:18 +0000 (+0300) Subject: Another part that needs special handling for root X-Git-Tag: v1.0~92^2~229 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=f05f98e4feb9a6100301800870c74365c5430ac9;p=nnn.git Another part that needs special handling for root --- diff --git a/noice.c b/noice.c index d03400e9..f224c964 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);