diff --git a/src/browser.c b/src/browser.c index 4d784bd..a846262 100644 --- a/src/browser.c +++ b/src/browser.c @@ -262,6 +262,16 @@ char *do_browser(char *path) continue; } #endif + /* Only if given path is exactly ".." then, after moving to + * parent direcory, highlight previous working directory. */ + if (strcmp(tail(path), "..") == 0 && + path[strlen(path) - 4] != '.' && + path[strlen(path) - 4] != '/' && + path[strlen(path) - 4] != '~') { + present_name = free_and_assign(present_name, + striponedir(path)); + } + /* Snip any trailing slashes, so the name can be compared. */ while (strlen(path) > 1 && path[strlen(path) - 1] == '/') path[strlen(path) - 1] = '\0';