correct hook for incorrect directory
authorLaurent Mazet <mazet@softndesign.org>
Thu, 2 Jan 2025 22:11:55 +0000 (23:11 +0100)
committerLaurent Mazet <mazet@softndesign.org>
Thu, 2 Jan 2025 22:11:55 +0000 (23:11 +0100)
fm.c
function.c

diff --git a/fm.c b/fm.c
index f01826e9cadfce1e2f6f9052f53a04397e4a97fb..acd5581910ebb9129600dc7ecb0e1eacd4cc0a3a 100644 (file)
--- a/fm.c
+++ b/fm.c
@@ -123,6 +123,12 @@ int main (int argc, char *argv[])
 
         if (list == NULL) {
             list = exploredir (dirname);
+            if (list == NULL) {
+                endwin ();
+                freewindow (windir);
+                VERBOSE (ERROR, fprintf (stderr, "can't read directory '%s'\n", dirname));
+                return 1;
+            }
         }
 
         clear ();
index 8bab6e14c6ee6b7e48b23d33653793747d779fd1..09561bd7abcf845e884466d0aec1d2958fe04fe6 100644 (file)
@@ -111,7 +111,6 @@ list_t *exploredir (char *dirname)
 {
     DIR *dir = opendir (dirname);
     if (dir == NULL) {
-        VERBOSE (WARNING, fprintf (stderr, "can't read directory '%s'\n", dirname));
         return NULL;
     }