From b7a4900cb288d19dc8bb4366414a2684429cc9bd Mon Sep 17 00:00:00 2001 From: aCaB Date: Thu, 29 Oct 2009 20:51:52 +0100 Subject: [PATCH] win32: check for .. and . at the end of path too --- win32/compat/w32_stat.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/win32/compat/w32_stat.c b/win32/compat/w32_stat.c index fabfcee4e..37fdeedcb 100644 --- a/win32/compat/w32_stat.c +++ b/win32/compat/w32_stat.c @@ -75,15 +75,15 @@ wchar_t *uncpath(const char *path) { } while((stripme = wcsstr(strip_from, L"\\."))) { wchar_t *copy_from, *copy_to; - if(stripme[2] == L'\\') { + if(!stripme[2] || stripme[2] == L'\\') { copy_from = &stripme[2]; copy_to = stripme; - } else if (stripme[2] == L'.' && stripme[3] == L'\\') { + } else if (stripme[2] == L'.' && (!stripme[3] || stripme[3] == L'\\')) { *stripme = L'\0'; copy_from = &stripme[3]; copy_to = wcsrchr(strip_from, L'\\'); if(!copy_to) - copy_to = strip_from; + copy_to = stripme; } else { strip_from = &stripme[1]; continue;