support unc style paths

This commit is contained in:
Daniel Beulshausen 2001-03-23 08:33:06 +00:00
parent cd1b11d2b7
commit 8889397ba8
2 changed files with 5 additions and 0 deletions

View File

@ -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

View File

@ -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