diff options
author | Ben Vickery <ben_vickery@trimble.com> | 2019-09-24 11:42:38 +1200 |
---|---|---|
committer | Harry Jeffery <harry@exec64.co.uk> | 2019-11-23 14:15:39 +0000 |
commit | df3c9316a6ebd7703136f02dd24c06562af01be4 (patch) | |
tree | 999c453077b43253a6f0a0266be968347cc4cfc8 /src | |
parent | dd3d60c3f9f12f1ca21c59474564f9b5098dd92c (diff) | |
download | imv-df3c9316a6ebd7703136f02dd24c06562af01be4.tar.gz |
Fix 'curl foo | imv -'. Closes #189
Fix to the fix contributed by escondida.
Diffstat (limited to 'src')
-rw-r--r-- | src/navigator.c | 6 |
1 files changed, 2 insertions, 4 deletions
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) { |