diff options
author | Christopher Faylor <me@cgf.cx> | 2000-09-11 17:21:13 +0000 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2000-09-11 17:21:13 +0000 |
commit | 867df927a6f8c548bbf62362de5d9aa53547d32f (patch) | |
tree | 9ba82676afddea7f2692aca6d1624e6048025544 /winsup/cygwin/path.cc | |
parent | 9149d76e50da76800d4394b1c8a7478ceeed94fa (diff) | |
download | cygnal-867df927a6f8c548bbf62362de5d9aa53547d32f.tar.gz cygnal-867df927a6f8c548bbf62362de5d9aa53547d32f.tar.bz2 cygnal-867df927a6f8c548bbf62362de5d9aa53547d32f.zip |
* path.cc (normalize_posix_path): Correctly deal with a "." parameter.
Diffstat (limited to 'winsup/cygwin/path.cc')
-rw-r--r-- | winsup/cygwin/path.cc | 13 |
1 files changed, 8 insertions, 5 deletions
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'; |