From: Laurent Mazet Date: Thu, 2 Jan 2025 22:11:55 +0000 (+0100) Subject: correct hook for incorrect directory X-Git-Tag: v1.0~74 X-Git-Url: https://secure.softndesign.org/git/?a=commitdiff_plain;h=2070fea9a85b4d91cfffd22a316bcaea92f320bb;p=fm.git correct hook for incorrect directory --- diff --git a/fm.c b/fm.c index f01826e..acd5581 100644 --- 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 (); diff --git a/function.c b/function.c index 8bab6e1..09561bd 100644 --- a/function.c +++ b/function.c @@ -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; }