From aeab80049082a2ade2d4f49055e27f31ea71dcc7 Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Fri, 1 Jul 2016 12:34:33 +0200 Subject: [PATCH] tweaks: improve a few comments --- src/browser.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/browser.c b/src/browser.c index c851332a..1d962abc 100644 --- a/src/browser.c +++ b/src/browser.c @@ -304,7 +304,7 @@ char *do_browser(char *path) } else if (func == do_enter) { struct stat st; - /* We can't move up from "/". */ + /* It isn't possible to move up from the root directory. */ if (strcmp(filelist[selected], "/..") == 0) { statusline(ALERT, _("Can't move up a directory")); continue; @@ -320,16 +320,15 @@ char *do_browser(char *path) continue; } #endif - + /* If for some reason the file is inaccessible, complain. */ if (stat(filelist[selected], &st) == -1) { - /* We can't open this file for some reason. Complain. */ statusline(ALERT, _("Error reading %s: %s"), filelist[selected], strerror(errno)); continue; } + /* If it isn't a directory, a file was selected -- we're done. */ if (!S_ISDIR(st.st_mode)) { - /* We've successfully opened a file, so we're done. */ retval = mallocstrcpy(NULL, filelist[selected]); break; }