commit f05f98e4feb9a6100301800870c74365c5430ac9
parent 327720107565e730a15b8d16351c8c4efd34a471
Author: lostd <lostd@2f30.org>
Date: Fri, 10 Oct 2014 13:22:18 +0300
Another part that needs special handling for root
Diffstat:
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git 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);