Browse Source

fix #7573

closedir() now really close the directory - used to stay open 'cause the
default-directory resource was "remembered" for arg-less calls.
PHP-4.0.5
Thies C. Arntzen 26 years ago
parent
commit
b80e71fdac
  1. 12
      ext/standard/dir.c

12
ext/standard/dir.c

@ -102,8 +102,12 @@ static void php_set_default_dir(int id DIRLS_DC)
if (DIRG(default_dir)!=-1) {
zend_list_delete(DIRG(default_dir));
}
DIRG(default_dir) = id;
zend_list_addref(id);
if (id != -1) {
zend_list_addref(id);
}
DIRG(default_dir) = id;
}
@ -211,6 +215,10 @@ PHP_FUNCTION(closedir)
FETCH_DIRP();
zend_list_delete(dirp->id);
if (dirp->id == DIRG(default_dir)) {
php_set_default_dir(-1);
}
}
/* }}} */

Loading…
Cancel
Save