--- ext/standard/filestat.c.orig Sat Nov 4 13:14:10 2006 +++ ext/standard/filestat.c Sat Nov 4 13:14:40 2006 @@ -633,6 +633,7 @@ efree(BG(CurrentLStatFile)); BG(CurrentLStatFile) = NULL; } + realpath_cache_empty(); } /* }}} */ --- TSRM/tsrm_virtual_cwd.c.orig Sat Nov 4 00:56:05 2006 +++ TSRM/tsrm_virtual_cwd.c Sat Nov 4 13:28:29 2006 @@ -360,6 +360,24 @@ return NULL; } +CWD_API int realpath_cache_empty(void) +{ + int i; + + for (i = 0; i < sizeof(CWDG(realpath_cache)) / sizeof(CWDG(realpath_cache)[0]); i++) { + realpath_cache_bucket *bucket = CWDG(realpath_cache)[i]; + + while (bucket != NULL) { + realpath_cache_bucket *r = bucket; + bucket = bucket->next; + free(r); + } + CWDG(realpath_cache)[i] = NULL; + } + CWDG(realpath_cache_size) = 0; + + return 0; +} /* Resolve path relatively to state and put the real path into state */ /* returns 0 for ok, 1 for error */ --- TSRM/tsrm_virtual_cwd.h.orig Sat Nov 4 02:39:04 2006 +++ TSRM/tsrm_virtual_cwd.h Sat Nov 4 13:12:50 2006 @@ -156,6 +156,7 @@ CWD_API DIR *virtual_opendir(const char *pathname TSRMLS_DC); CWD_API FILE *virtual_popen(const char *command, const char *type TSRMLS_DC); CWD_API int virtual_access(const char *pathname, int mode TSRMLS_DC); +CWD_API int realpath_cache_empty(void); #if defined(TSRM_WIN32) /* these are not defined in win32 headers */ #ifndef W_OK