commit 4957c1121d0f700155b591536bcfb01359c78492
parent d9d8eb2480e6b2d816ed1f13599f6f3c247a7031
Author: Rishabh Dave <rishabhddave@gmail.com>
Date: Fri, 1 Jul 2016 19:24:28 +0530
browser: select an inaccessible directory also when tabbed
When the user tab-completed a name at the Go To Directory prompt, this
name will end in a slash. Remove this slash, so the name can be found
in the file list (where directory names don't include the final slash).
This fixes http://savannah.gnu.org/bugs/?48353.
Signed-off-by: Rishabh Dave <rishabhddave@gmail.com>
Diffstat:
1 file changed, 4 insertions(+), 0 deletions(-)
diff --git a/src/browser.c b/src/browser.c
@@ -271,6 +271,10 @@ 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++)