From 03a81aa9c5c96aca04eaf2ac77678d512a732bd2 Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Sun, 3 Jul 2016 16:18:26 +0200 Subject: [PATCH] browser: trim all trailing slashes (just in case there are more) --- src/browser.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/browser.c b/src/browser.c index 940f08e0..9304d3fa 100644 --- a/src/browser.c +++ b/src/browser.c @@ -271,8 +271,8 @@ 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] == '/') + /* Snip any trailing slashes, so the name can be compared. */ + while (strlen(newpath) > 1 && newpath[strlen(newpath) - 1] == '/') newpath[strlen(newpath) - 1] = '\0'; /* In case the specified directory cannot be entered, select it