From df3c9316a6ebd7703136f02dd24c06562af01be4 Mon Sep 17 00:00:00 2001 From: Ben Vickery Date: Tue, 24 Sep 2019 11:42:38 +1200 Subject: Fix 'curl foo | imv -'. Closes #189 Fix to the fix contributed by escondida. --- src/navigator.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/navigator.c b/src/navigator.c index c2a5f5f..c399404 100644 --- a/src/navigator.c +++ b/src/navigator.c @@ -73,10 +73,8 @@ int imv_navigator_add(struct imv_navigator *nav, const char *path, { char path_buf[PATH_MAX+1]; struct stat path_info; - if (stat(path, &path_info)) { - return 1; - } - if (S_ISDIR(path_info.st_mode)) { + if ((stat(path, &path_info) == 0) && + S_ISDIR(path_info.st_mode)) { int result = 0; DIR *d = opendir(path); if (d) { -- cgit v1.2.3