From: Sascha Schumann Date: Wed, 24 May 2000 14:41:28 +0000 (+0000) Subject: If no further directory exists, php_readdir_r() returns success and sets X-Git-Tag: PRE_EIGHT_BYTE_ALLOC_PATCH~266 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=faf4f764b72ba3b71fef601c70ee3de6165f693f;p=php If no further directory exists, php_readdir_r() returns success and sets *result to NULL. --- diff --git a/main/reentrancy.c b/main/reentrancy.c index c180a5af2b..4677d52ea2 100644 --- a/main/reentrancy.c +++ b/main/reentrancy.c @@ -108,8 +108,10 @@ PHPAPI int php_readdir_r(DIR *dirp, struct dirent *entry, if (ret == 0) *result = entry; - else + else if (errno == 0) { *result = NULL; + ret = 0; + } return ret; #else