browser: trim all trailing slashes (just in case there are more)

This commit is contained in:
Benno Schulenberg 2016-07-03 16:18:26 +02:00
parent 4957c1121d
commit 03a81aa9c5

View File

@ -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