mirror of
https://github.com/php/php-src.git
synced 2026-04-10 17:43:13 +02:00
fix #7573
closedir() now really close the directory - used to stay open 'cause the default-directory resource was "remembered" for arg-less calls.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
/* }}} */
|
||||
|
||||
Reference in New Issue
Block a user