diff --git a/TSRM/tsrm_virtual_cwd.c b/TSRM/tsrm_virtual_cwd.c index b82b6f8587e..0e54b0996fe 100644 --- a/TSRM/tsrm_virtual_cwd.c +++ b/TSRM/tsrm_virtual_cwd.c @@ -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 diff --git a/TSRM/tsrm_virtual_cwd.h b/TSRM/tsrm_virtual_cwd.h index 7ea7aa4cbfc..b47159a0ff3 100644 --- a/TSRM/tsrm_virtual_cwd.h +++ b/TSRM/tsrm_virtual_cwd.h @@ -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