Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2016-11-28 14:33:40 +0300
committerCorinna Vinschen <corinna@vinschen.de>2016-11-28 14:33:40 +0300
commitf0ae353a4fe00d3a33fdebaedc28ebac685463ad (patch)
tree7417b7a09e68c91c4d3d6cd0371e66dca408346d
parenta43e81e2330204cb37ee50363b4e1d9c1ec5c19a (diff)
path_conv: When encountering a ".(/)+" sequence, skip *all* slashes
The original code only skipped the "./", but missed to test if more trailing slashes are present. This in turn leads to invalid conversion. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
-rw-r--r--winsup/cygwin/path.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc
index aaf192820..3d07ea176 100644
--- a/winsup/cygwin/path.cc
+++ b/winsup/cygwin/path.cc
@@ -1406,7 +1406,12 @@ normalize_win32_path (const char *src, char *dst, char *&tail)
/* Ignore "./". */
else if (src[0] == '.' && isdirsep (src[1])
&& (src == src_start || isdirsep (src[-1])))
- src += 2;
+ {
+ src += 2;
+ /* Skip /'s to the next path component. */
+ while (isdirsep (*src))
+ src++;
+ }
/* Backup if "..". */
else if (src[0] == '.' && src[1] == '.'