Index: TSRM/tsrm_virtual_cwd.c =================================================================== RCS file: /repository/TSRM/tsrm_virtual_cwd.c,v retrieving revision 1.74.2.9.2.30 diff -u -p -d -r1.74.2.9.2.30 tsrm_virtual_cwd.c --- TSRM/tsrm_virtual_cwd.c 18 Jun 2007 09:50:39 -0000 1.74.2.9.2.30 +++ TSRM/tsrm_virtual_cwd.c 29 Jun 2007 10:48:45 -0000 @@ -480,8 +480,13 @@ CWD_API int virtual_file_ex(cwd_state *s use_cache = ((use_realpath != CWD_EXPAND) && CWDG(realpath_cache_size_limit)); - if (path_length == 0) - return (0); + if (path_length == 0) { + if (use_realpath == CWD_REALPATH) { + return (0); + } else { + return (1); + } + } if (path_length >= MAXPATHLEN) return (1); Index: main/fopen_wrappers.c =================================================================== RCS file: /repository/php-src/main/fopen_wrappers.c,v retrieving revision 1.175.2.3.2.12 diff -u -p -d -r1.175.2.3.2.12 fopen_wrappers.c --- main/fopen_wrappers.c 1 Jun 2007 13:35:23 -0000 1.175.2.3.2.12 +++ main/fopen_wrappers.c 29 Jun 2007 10:48:45 -0000 @@ -605,8 +605,14 @@ PHPAPI char *expand_filepath(const char cwd_state new_state; char cwd[MAXPATHLEN]; char *result; + int filepath_len = strlen(filepath); - if (IS_ABSOLUTE_PATH(filepath, strlen(filepath))) { + if (!filepath_len) { + real_path[0] = '\0'; + return real_path; + } + + if (IS_ABSOLUTE_PATH(filepath, filepath_len)) { cwd[0] = '\0'; } else{ result = VCWD_GETCWD(cwd, MAXPATHLEN);