cvs: TSRM(PHP_5_2) / tsrm_virtual_cwd.c

From: Date: Mon, 23 Jul 2007 08:57:04 +0000
Subject: cvs: TSRM(PHP_5_2) / tsrm_virtual_cwd.c
Groups: php.zend-engine.cvs 
Request: Send a blank email to php-zend-engine-cvs+get-5916@lists.php.net to get a copy of this message
dmitry Mon Jul 23 08:57:04 2007 UTC Modified files: (Branch: PHP_5_2) /TSRM tsrm_virtual_cwd.c Log: Fixed rename() in ZTS to allow renaming of symbolic links; Consistent handling of trailing slash http://cvs.php.net/viewvc.cgi/TSRM/tsrm_virtual_cwd.c?r1=1.74.2.9.2.32&r2=1.74.2.9.2.33&diff_format=u Index: TSRM/tsrm_virtual_cwd.c diff -u TSRM/tsrm_virtual_cwd.c:1.74.2.9.2.32 TSRM/tsrm_virtual_cwd.c:1.74.2.9.2.33 --- TSRM/tsrm_virtual_cwd.c:1.74.2.9.2.32 Tue Jul 10 13:21:11 2007 +++ TSRM/tsrm_virtual_cwd.c Mon Jul 23 08:57:04 2007 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: tsrm_virtual_cwd.c,v 1.74.2.9.2.32 2007/07/10 13:21:11 dmitry Exp $ */ +/* $Id: tsrm_virtual_cwd.c,v 1.74.2.9.2.33 2007/07/23 08:57:04 dmitry Exp $ */ #include <sys/types.h> #include <sys/stat.h> @@ -692,6 +692,15 @@ } 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); @@ -979,14 +988,14 @@ int retval; CWD_STATE_COPY(&old_state, &CWDG(cwd)); - if (virtual_file_ex(&old_state, oldname, NULL, CWD_REALPATH)) { + if (virtual_file_ex(&old_state, oldname, NULL, CWD_EXPAND)) { CWD_STATE_FREE(&old_state); return -1; } oldname = old_state.cwd; CWD_STATE_COPY(&new_state, &CWDG(cwd)); - if (virtual_file_ex(&new_state, newname, NULL, CWD_FILEPATH)) { + if (virtual_file_ex(&new_state, newname, NULL, CWD_EXPAND)) { CWD_STATE_FREE(&old_state); CWD_STATE_FREE(&new_state); return -1;

« previous php.zend-engine.cvs (#5916) next »