From: Andi Gutmans Date: Sun, 29 Apr 2001 17:57:23 +0000 (+0000) Subject: - Fix bug Bug id #5987. It could be fixed by changing readdir.c but I X-Git-Tag: php-4.0.6RC1~260 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=21603118b1616c0c3e80535a4bfee5ff0a8376df;p=php - Fix bug Bug id #5987. It could be fixed by changing readdir.c but I - prefered not to touch that code but to treat windows a bit differently - in dir.c PR: Submitted by: Reviewed by: Obtained from: --- diff --git a/ext/standard/dir.c b/ext/standard/dir.c index 97e2b547e7..e00569fe28 100644 --- a/ext/standard/dir.c +++ b/ext/standard/dir.c @@ -167,8 +167,12 @@ static void _php_do_opendir(INTERNAL_FUNCTION_PARAMETERS, int createobject) dirp = emalloc(sizeof(php_dir)); dirp->dir = V_OPENDIR((*arg)->value.str.val); - - if (! dirp->dir) { + +#ifdef PHP_WIN32 + if (!dirp->dir || dirp->dir->finished) { +#else + if (!dirp->dir) { +#endif efree(dirp); php_error(E_WARNING, "OpenDir: %s (errno %d)", strerror(errno), errno); RETURN_FALSE;