From 787908c1731aeb56fe3a8a8e4caf396885146fff Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Sat, 18 Jun 2011 08:36:59 +0000 Subject: [PATCH] * path.cc (normalize_win32_path): Skip all slashes after recognizing a ".." path component. Add comment. --- winsup/cygwin/ChangeLog | 5 +++++ winsup/cygwin/path.cc | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 9ee89e9b2..559f99efe 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,8 @@ +2011-06-18 Corinna Vinschen + + * path.cc (normalize_win32_path): Skip all slashes after recognizing + a ".." path component. Add comment. + 2011-06-17 Corinna Vinschen * fhandler.cc (fhandler_base::open): Drop local create_options variable. diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc index 7b4f124e7..d3e5bb6db 100644 --- a/winsup/cygwin/path.cc +++ b/winsup/cygwin/path.cc @@ -1258,7 +1258,8 @@ normalize_win32_path (const char *src, char *dst, char *&tail) while (tail > dst + 1 && tail[-1] != '\\' && tail[-2] != ':') tail--; src += 2; - if (isdirsep (*src)) + /* Skip /'s to the next path component. */ + while (isdirsep (*src)) src++; } }