aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar lostd <lostd@2f30.org>2014-10-07 21:02:58 +0300
committerGravatar lostd <lostd@2f30.org>2014-10-07 21:02:58 +0300
commitc5e5a19d0f3a8a2180f924beedcbb272073de218 (patch)
treef39a7fcc9ee85b14b369ba71051c589236790ee0
parent1475ebbf9a5166bed3946707a113a93552e385c3 (diff)
downloadnnn-c5e5a19d0f3a8a2180f924beedcbb272073de218.tar.gz
Comment on the multiple slashes handling logic
-rw-r--r--noice.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/noice.c b/noice.c
index 0f8e61f..90680d1 100644
--- a/noice.c
+++ b/noice.c
@@ -263,7 +263,7 @@ redraw:
/* Clean screen */
erase();
- /* Strip slashes */
+ /* Strip trailing slashes */
for (i = strlen(path) - 1; i > -1; i--)
if (path[i] == '/')
path[i] = '\0';
@@ -286,7 +286,9 @@ redraw:
tmpents[i].name[COLS - strlen(CURSR) - 1] = '\0';
}
- /* Print cwd */
+ /* Print cwd. If empty we are on the root. We store it
+ * as an empty string so that when we navigate in /mnt
+ * is doesn't come up as //mnt. */
printw(CWD "%s%s\n\n",
strncmp(cwd, "", 1) == 0 ? "/" : "",
cwd);