From 7203adb1cc1170a7844a79af8d03e14c3fed6e21 Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Fri, 21 Apr 2000 14:37:48 +0000 Subject: [PATCH] Fix handling of /.filename --- winsup/cygwin/ChangeLog | 2 +- winsup/cygwin/path.cc | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index c573a3483..12df069d9 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,4 +1,4 @@ -Fri Apr 21 01:27:47 2000 Christopher Faylor +Fri Apr 21 10:37:08 2000 Christopher Faylor * path.cc (normalize_posix_path): Previous two patches were still incorrect so rewrite this function to deal with trailing dots. diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc index 0290ed7a3..463fb6c4f 100644 --- a/winsup/cygwin/path.cc +++ b/winsup/cygwin/path.cc @@ -561,7 +561,11 @@ normalize_posix_path (const char *cwd, const char *src, char *dst) strcpy (dst, cwd); dst = strchr (dst, '\0'); if (*src == '.') - goto sawdot; + { + if (dst == dst_start + 1) + dst--; + goto sawdot; + } if (dst > dst_start && !isslash (dst[-1])) *dst++ = '/'; }