mirror of
https://github.com/php/php-src.git
synced 2024-11-23 09:54:15 +08:00
support unc style paths
This commit is contained in:
parent
cd1b11d2b7
commit
8889397ba8
@ -313,6 +313,9 @@ CWD_API int virtual_file_ex(cwd_state *state, const char *path, verify_path_func
|
||||
copy_amount = COPY_WHEN_ABSOLUTE;
|
||||
is_absolute = 1;
|
||||
#ifdef TSRM_WIN32
|
||||
} else if(IS_UNC_PATH(path_copy, path_length)){
|
||||
copy_amount = 1;
|
||||
is_absolute = 1;
|
||||
} else if(IS_SLASH(path_copy[0])) {
|
||||
copy_amount = 2;
|
||||
#endif
|
||||
|
@ -51,6 +51,8 @@ typedef unsigned short mode_t;
|
||||
#define COPY_WHEN_ABSOLUTE 2
|
||||
#define IS_ABSOLUTE_PATH(path, len) \
|
||||
(len >= 2 && isalpha(path[0]) && path[1] == ':')
|
||||
#define IS_UNC_PATH(path, len) \
|
||||
(len >= 2 && IS_SLASH(path[0]) && IS_SLASH(path[1]))
|
||||
|
||||
#else
|
||||
#ifdef HAVE_DIRENT_H
|
||||
|
Loading…
Reference in New Issue
Block a user