From: Dmitry Stogov Date: Fri, 26 Jan 2007 15:15:16 +0000 (+0000) Subject: Fixed bug #40231 (file_exists incorrectly reports false) X-Git-Tag: php-5.2.1~33 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=cb443c6e5ad489d6e75033245b2888644bd3665c;p=php Fixed bug #40231 (file_exists incorrectly reports false) --- diff --git a/NEWS b/NEWS index fe56040754..ad9614e32c 100644 --- a/NEWS +++ b/NEWS @@ -1,5 +1,8 @@ PHP NEWS ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| +?? ??? 2007, PHP 5.2.1 +- Fixed bug #40231 (file_exists incorrectly reports false). (Dmitry) + 25 Jan 2007, PHP 5.2.1RC4 - Fixed PECL bug #7295 (ORA-01405: fetched column value is NULL on LOB fields). (Tony) diff --git a/TSRM/tsrm_virtual_cwd.c b/TSRM/tsrm_virtual_cwd.c index 33285bab09..db74fcbbe9 100644 --- a/TSRM/tsrm_virtual_cwd.c +++ b/TSRM/tsrm_virtual_cwd.c @@ -550,6 +550,9 @@ CWD_API int virtual_file_ex(cwd_state *state, const char *path, verify_path_func char *ptr, *path_copy, *free_path; char *tok = NULL; int ptr_length; +#ifdef TSRM_WIN32 + int is_unc = 0; +#endif no_realpath: @@ -570,6 +573,7 @@ no_realpath: state->cwd[1] = '\0'; state->cwd_length = 1; path_copy += 2; + is_unc = 2; } else { #endif state->cwd = (char *) realloc(state->cwd, 1); @@ -649,10 +653,14 @@ no_realpath: ptr_length = length; FindClose(hFind); } else if (use_realpath == CWD_REALPATH) { - free(free_path); - CWD_STATE_FREE(state); - *state = old_state; - return 1; + if (is_unc) { + is_unc--; + } else { + free(free_path); + CWD_STATE_FREE(state); + *state = old_state; + return 1; + } } } #endif