Fix fisdir sigfault on Hurd

Apparently Hurd's stat() does not like NULL and will sigfault, this patch takes
care of it.
This commit is contained in:
yangfl
2022-01-26 02:11:08 +08:00
parent 8120492fc8
commit 0cda6339a4
+1 -1
View File
@@ -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;