From 07ddc21a658b537bb41845f34d05b1e2f406a5ae Mon Sep 17 00:00:00 2001 From: Rishabh Dave Date: Fri, 1 Jul 2016 19:24:28 +0530 Subject: [PATCH] browser: select inaccessible directory when tabbed In Go To Directory prompt in browser, select inaccessible directory also when name of a directory is completed using Tab key. This fixes http://savannah.gnu.org/bugs/?48353. Signed-off-by: Rishabh Dave --- src/browser.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/browser.c b/src/browser.c index 9bcecfa..576a4e2 100644 --- a/src/browser.c +++ b/src/browser.c @@ -275,6 +275,11 @@ char *do_browser(char *path) continue; } #endif + + /* Snip a trailing slash, so the name can be compared. */ + if (strlen(newpath) > 1 && newpath[strlen(newpath) - 1] == '/') + newpath[strlen(newpath) - 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