]> Sergey Matveev's repositories - nnn.git/commitdiff
Comment on the multiple slashes handling logic
authorlostd <lostd@2f30.org>
Tue, 7 Oct 2014 18:02:58 +0000 (21:02 +0300)
committerlostd <lostd@2f30.org>
Tue, 7 Oct 2014 18:02:58 +0000 (21:02 +0300)
noice.c

diff --git a/noice.c b/noice.c
index 0f8e61f2e16677a10074939ac9b3f916c3eb319f..90680d1998ea2cc432d617c606954a444b1c5e66 100644 (file)
--- 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);