From ff7df5dd75f5e2a9ad6ff4438c099753d80f864a Mon Sep 17 00:00:00 2001 From: cgf Date: Mon, 20 Dec 2004 17:55:21 +0000 Subject: [PATCH] * path.cc (normalize_win32_path): Remove unneeded check for dots. --- winsup/cygwin/ChangeLog | 4 ++++ winsup/cygwin/path.cc | 11 +++-------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index f65841b541..62e112b279 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,5 +1,9 @@ 2004-12-20 Christopher Faylor + * path.cc (normalize_win32_path): Remove unneeded check for dots. + +2004-12-20 Christopher Faylor + * path.cc (normalize_posix_path): Remove unneeded check for dots. (path_conv::set_normalized_path): Strip trailing dots, similarly to what had previously been done for the win32 path. diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc index f1c25c4c8c..87f3c7a025 100644 --- a/winsup/cygwin/path.cc +++ b/winsup/cygwin/path.cc @@ -1010,7 +1010,9 @@ normalize_win32_path (const char *src, char *dst, char *&tail) /* dst must be greater than dst_start */ && tail[-1] == '\\') { - if (isdirsep (src[2]) || src[2] == 0) + if (!isdirsep (src[2]) && src[2] != '\0') + *tail++ = *src++; + else { /* Back up over /, but not if it's the first one. */ if (tail > dst + 1) @@ -1022,13 +1024,6 @@ normalize_win32_path (const char *src, char *dst, char *&tail) if (isdirsep (*src)) src++; } - else - { - int n = strspn (src, "."); - if (!src[n] || isdirsep (src[n])) /* just dots... */ - return ENOENT; - *tail++ = *src++; - } } /* Otherwise, add char to result. */ else -- 2.11.0