From 0cda6339a4687234bd68d66713a3be59cbedbeec Mon Sep 17 00:00:00 2001 From: yangfl Date: Tue, 25 Jan 2022 21:04:39 +0800 Subject: [PATCH] Fix fisdir sigfault on Hurd Apparently Hurd's stat() does not like NULL and will sigfault, this patch takes care of it. --- src/fisdir.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fisdir.c b/src/fisdir.c index 1626eee..fd5384d 100644 --- a/src/fisdir.c +++ b/src/fisdir.c @@ -41,7 +41,7 @@ int fisdir(const char *path) { struct stat sb; - if (!stat(path, &sb) && S_ISDIR(sb.st_mode)) + if (path && !stat(path, &sb) && S_ISDIR(sb.st_mode)) return 1; return 0;