Переглянути джерело

Comment on the multiple slashes handling logic

master
lostd 10 роки тому
джерело
коміт
c5e5a19d0f
1 змінених файлів з 4 додано та 2 видалено
  1. +4
    -2
      noice.c

+ 4
- 2
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);


Завантаження…
Відмінити
Зберегти