dmitry Tue Nov 13 09:47:07 2007 UTC Added files: (Branch: PHP_5_3) /php-src/ext/standard/tests/file bug43248.phpt
Modified files: /TSRM tsrm_virtual_cwd.c Log: Fixed bug #43248 (backward compatibility break in realpath()) http://cvs.php.net/viewvc.cgi/TSRM/tsrm_virtual_cwd.c?r1=1.74.2.9.2.35.2.1&r2=1.74.2.9.2.35.2.2&diff_format=u Index: TSRM/tsrm_virtual_cwd.c diff -u TSRM/tsrm_virtual_cwd.c:1.74.2.9.2.35.2.1 TSRM/tsrm_virtual_cwd.c:1.74.2.9.2.35.2.2 --- TSRM/tsrm_virtual_cwd.c:1.74.2.9.2.35.2.1 Tue Oct 23 05:57:25 2007 +++ TSRM/tsrm_virtual_cwd.c Tue Nov 13 09:47:06 2007 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: tsrm_virtual_cwd.c,v 1.74.2.9.2.35.2.1 2007/10/23 05:57:25 dmitry Exp $ */ +/* $Id: tsrm_virtual_cwd.c,v 1.74.2.9.2.35.2.2 2007/11/13 09:47:06 dmitry Exp $ */ #include <sys/types.h> #include <sys/stat.h> @@ -712,22 +712,25 @@ } ptr = tsrm_strtok_r(NULL, TOKENIZER_STRING, &tok); } -#if defined(TSRM_WIN32) || defined(NETWARE) - if (path[path_length-1] == '\\' || path[path_length-1] == '/') { -#else - if (path[path_length-1] == '/') { -#endif - state->cwd = (char*)realloc(state->cwd, state->cwd_length + 2); - state->cwd[state->cwd_length++] = DEFAULT_SLASH; - state->cwd[state->cwd_length] = 0; - } free(free_path); - if ((use_realpath == CWD_REALPATH) && ret) { - CWD_STATE_FREE(state); - *state = old_state; - return 1; + if (use_realpath == CWD_REALPATH) { + if (ret) { + CWD_STATE_FREE(state); + *state = old_state; + return 1; + } + } else { +#if defined(TSRM_WIN32) || defined(NETWARE) + if (path[path_length-1] == '\\' || path[path_length-1] == '/') { +#else + if (path[path_length-1] == '/') { +#endif + state->cwd = (char*)realloc(state->cwd, state->cwd_length + 2); + state->cwd[state->cwd_length++] = DEFAULT_SLASH; + state->cwd[state->cwd_length] = 0; + } } if (state->cwd_length == COPY_WHEN_ABSOLUTE(state->cwd)) { http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/file/bug43248.phpt?view=markup&rev=1.1 Index: php-src/ext/standard/tests/file/bug43248.phpt +++ php-src/ext/standard/tests/file/bug43248.phpt -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php