]> granicus.if.org Git - php/commitdiff
- Fix bug Bug id #5987. It could be fixed by changing readdir.c but I
authorAndi Gutmans <andi@php.net>
Sun, 29 Apr 2001 17:57:23 +0000 (17:57 +0000)
committerAndi Gutmans <andi@php.net>
Sun, 29 Apr 2001 17:57:23 +0000 (17:57 +0000)
- prefered not to touch that code but to treat windows a bit differently
- in dir.c
PR:
Submitted by:
Reviewed by:
Obtained from:

ext/standard/dir.c

index 97e2b547e7c08bb9a68aa13446ada5506d3bf117..e00569fe287e9511fd1ca08c76d88a021b408f3d 100644 (file)
@@ -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;