diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 5f45854a3..c43ec6ed6 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,7 @@ +Mon Sep 11 13:19:15 2000 Christopher Faylor + + * path.cc (normalize_posix_path): Correctly deal with a "." parameter. + Sun Sep 10 20:23:35 2000 Christopher Faylor * cygheap.cc (init_cheap): Just use any old address for the cygwin diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc index 58a1fb8bc..54b879560 100644 --- a/winsup/cygwin/path.cc +++ b/winsup/cygwin/path.cc @@ -593,8 +593,8 @@ normalize_posix_path (const char *src, char *dst) { while (*++src) { - while (isslash (*src)) - src++; + if (isslash (*src)) + continue; if (*src != '.') break; @@ -602,13 +602,15 @@ normalize_posix_path (const char *src, char *dst) sawdot: if (src[1] != '.') { - if (!src[1] || !isslash (src[1])) + if (!src[1]) + goto done; + if (!isslash (src[1])) break; } + else if (src[2] && !isslash (src[2])) + break; else { - if (src[2] && !isslash (src[2])) - break; if (!ischrootpath (dst_start) || dst - dst_start != (int) myself->rootlen) while (dst > dst_start && !isslash (*--dst)) @@ -621,6 +623,7 @@ normalize_posix_path (const char *src, char *dst) } } +done: *dst = '\0'; if (--dst > dst_start && isslash (*dst)) *dst = '\0';