@@ -957,40 +957,6 @@ static size_t tsrm_realpath_r(char *path, size_t start, size_t len, int *ll, tim
957
957
}
958
958
/* }}} */
959
959
960
- #ifdef ZEND_WIN32
961
- static size_t tsrm_win32_realpath_quick (char * path , size_t len , time_t * t ) /* {{{ */
962
- {
963
- char tmp_resolved_path [MAXPATHLEN ];
964
- int tmp_resolved_path_len ;
965
- BY_HANDLE_FILE_INFORMATION info ;
966
- realpath_cache_bucket * bucket ;
967
-
968
- if (!* t ) {
969
- * t = time (0 );
970
- }
971
-
972
- if (CWDG (realpath_cache_size_limit ) && (bucket = realpath_cache_find (path , len , * t )) != NULL ) {
973
- memcpy (path , bucket -> realpath , bucket -> realpath_len + 1 );
974
- return bucket -> realpath_len ;
975
- }
976
-
977
- if (!php_win32_ioutil_realpath_ex0 (path , tmp_resolved_path , & info )) {
978
- DWORD err = GetLastError ();
979
- SET_ERRNO_FROM_WIN32_CODE (err );
980
- return (size_t )-1 ;
981
- }
982
-
983
- tmp_resolved_path_len = strlen (tmp_resolved_path );
984
- if (CWDG (realpath_cache_size_limit )) {
985
- realpath_cache_add (path , len , tmp_resolved_path , tmp_resolved_path_len , info .dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY , * t );
986
- }
987
- memmove (path , tmp_resolved_path , tmp_resolved_path_len + 1 );
988
-
989
- return tmp_resolved_path_len ;
990
- }
991
- /* }}} */
992
- #endif
993
-
994
960
/* Resolve path relatively to state and put the real path into state */
995
961
/* returns 0 for ok, 1 for error */
996
962
CWD_API int virtual_file_ex (cwd_state * state , const char * path , verify_path_func verify_path , int use_realpath ) /* {{{ */
@@ -1118,27 +1084,7 @@ CWD_API int virtual_file_ex(cwd_state *state, const char *path, verify_path_func
1118
1084
1119
1085
add_slash = (use_realpath != CWD_REALPATH ) && path_length > 0 && IS_SLASH (resolved_path [path_length - 1 ]);
1120
1086
t = CWDG (realpath_cache_ttl ) ? 0 : -1 ;
1121
- #ifdef ZEND_WIN32
1122
- if (CWD_EXPAND != use_realpath ) {
1123
- size_t tmp_len = tsrm_win32_realpath_quick (resolved_path , path_length , & t );
1124
- if ((size_t )-1 != tmp_len ) {
1125
- path_length = tmp_len ;
1126
- } else {
1127
- DWORD err = GetLastError ();
1128
- /* The access denied error can mean something completely else,
1129
- fallback to complicated way. */
1130
- if (CWD_REALPATH == use_realpath && ERROR_ACCESS_DENIED != err ) {
1131
- SET_ERRNO_FROM_WIN32_CODE (err );
1132
- return 1 ;
1133
- }
1134
- path_length = tsrm_realpath_r (resolved_path , start , path_length , & ll , & t , use_realpath , 0 , NULL );
1135
- }
1136
- } else {
1137
- path_length = tsrm_realpath_r (resolved_path , start , path_length , & ll , & t , use_realpath , 0 , NULL );
1138
- }
1139
- #else
1140
1087
path_length = tsrm_realpath_r (resolved_path , start , path_length , & ll , & t , use_realpath , 0 , NULL );
1141
- #endif
1142
1088
1143
1089
if (path_length == (size_t )-1 ) {
1144
1090
errno = ENOENT ;
0 commit comments