From f5da5bd6195df3dd23ecc05bc8b75e7448eca656 Mon Sep 17 00:00:00 2001 From: Rishabh Dave Date: Fri, 1 Jul 2016 19:45:33 +0530 Subject: [PATCH] browser: select inaccessible directory when tabbed In Go To Directory prompt in browser, inaccessible directory must be selected also when name of directory was completed using tab. This fixes http://savannah.gnu.org/bugs/?48353. Signed-off-by: Rishabh Dave --- src/browser.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/browser.c b/src/browser.c index 9bcecfa..02eb4ef 100644 --- a/src/browser.c +++ b/src/browser.c @@ -275,6 +275,12 @@ char *do_browser(char *path) continue; } #endif + + /* Snip a trailing slash, so the name can be compared. */ + i = strlen(newpath); + if (strlen(newpath) > 1 && newpath[i - 1] == '/') + newpath[i - 1] = '\0'; + /* In case the specified directory cannot be entered, select it * (if it is in the current list) so it will be highlighted. */ for (i = 0; i < filelist_len; i++) -- 2.9.0