cvs: TSRM / tsrm_virtual_cwd.c

From: Date: Mon, 23 Jul 2007 08:57:20 +0000
Subject: cvs: TSRM / tsrm_virtual_cwd.c
Groups: php.zend-engine.cvs 
Request: Send a blank email to php-zend-engine-cvs+get-5917@lists.php.net to get a copy of this message
dmitry Mon Jul 23 08:57:20 2007 UTC Modified files: /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.112&r2=1.113&diff_format=u Index: TSRM/tsrm_virtual_cwd.c diff -u TSRM/tsrm_virtual_cwd.c:1.112 TSRM/tsrm_virtual_cwd.c:1.113 --- TSRM/tsrm_virtual_cwd.c:1.112 Tue Jul 10 13:21:30 2007 +++ TSRM/tsrm_virtual_cwd.c Mon Jul 23 08:57:20 2007 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: tsrm_virtual_cwd.c,v 1.112 2007/07/10 13:21:30 dmitry Exp $ */ +/* $Id: tsrm_virtual_cwd.c,v 1.113 2007/07/23 08:57:20 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 (#5917) next »