From b0f1cf741faf7328987fb0da0f0665fef7a3c2e4 Mon Sep 17 00:00:00 2001 From: Rishabh Dave Date: Tue, 24 May 2016 18:30:03 +0530 Subject: [PATCH 2/2] browser: Move opendir() & closedir() to do_browser() Move opendir() & closedir() to do_browser() from do_browse_from() & browser_init(), respectively, to make these operations clear while reading the program. This makes dir parameter redundant for do_browser() & do_browse_from(), so it is removed. Signed-off-by: Rishabh Dave --- src/browser.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/browser.c b/src/browser.c index 4f45290..95779e3 100644 --- a/src/browser.c +++ b/src/browser.c @@ -57,6 +57,7 @@ char *do_browser(char *path) /* The function of the key the user typed in. */ DIR *dir = NULL; + /* We already checked if path is NULL, in do_browse_from(). */ dir = opendir(path); /* If we can't open the path, get out. */ if (dir == NULL) { -- 2.8.3