From 44e75b6cddd9969d6cd6b188027806df57287b55 Mon Sep 17 00:00:00 2001 From: Zeev Suraski Date: Wed, 27 Jun 2001 14:30:02 +0000 Subject: [PATCH] Fix UNC path handling --- TSRM/tsrm_virtual_cwd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/TSRM/tsrm_virtual_cwd.c b/TSRM/tsrm_virtual_cwd.c index 3e8789f8af..db42eccc0e 100644 --- a/TSRM/tsrm_virtual_cwd.c +++ b/TSRM/tsrm_virtual_cwd.c @@ -315,7 +315,7 @@ CWD_API int virtual_file_ex(cwd_state *state, const char *path, verify_path_func is_absolute = 1; #ifdef TSRM_WIN32 } else if (IS_UNC_PATH(path_copy, path_length)) { - copy_amount = 1; + copy_amount = 2; is_absolute = 1; } else if (IS_SLASH(path_copy[0])) { copy_amount = 2; @@ -366,7 +366,7 @@ CWD_API int virtual_file_ex(cwd_state *state, const char *path, verify_path_func state->cwd = (char *) realloc(state->cwd, state->cwd_length+ptr_length+1+1); #ifdef TSRM_WIN32 /* Windows 9x will consider C:\\Foo as a network path. Avoid it. */ - if (state->cwd[state->cwd_length-1]!=DEFAULT_SLASH) { + if (state->cwd[state->cwd_length-1]!='\\' && state->cwd[state->cwd_length-1]!='/') { state->cwd[state->cwd_length++] = DEFAULT_SLASH; } #else -- 2.50.1