From: Derick Rethans Date: Fri, 2 May 2008 14:08:44 +0000 (+0000) Subject: - MF53: fix for bug #44870: rename() on directory deletes same named file. X-Git-Tag: RELEASE_2_0_0b1~113 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d5a323788aee0e9513184fe68e50d277055e28c8;p=php - MF53: fix for bug #44870: rename() on directory deletes same named file. (Patch by Pierre) --- diff --git a/TSRM/tsrm_virtual_cwd.h b/TSRM/tsrm_virtual_cwd.h index b9ecdf537a..d94f3adf69 100644 --- a/TSRM/tsrm_virtual_cwd.h +++ b/TSRM/tsrm_virtual_cwd.h @@ -299,7 +299,7 @@ CWD_API void realpath_cache_del(const char *path, int path_len TSRMLS_DC); #if defined(TSRM_WIN32) # define VCWD_RENAME(oldname, newname) MoveFileEx(oldname, newname, MOVEFILE_REPLACE_EXISTING) #else -# define VCWD_RENAME(oldname, newname) rename(oldname, newname) +# define VCWD_RENAME(oldname, newname) (MoveFileEx(oldname, newname, MOVEFILE_REPLACE_EXISTING) == 0 ? -1 : 0) #endif #define VCWD_CHDIR(path) chdir(path) #define VCWD_CHDIR_FILE(path) virtual_chdir_file(path, chdir)