From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 112468 invoked by alias); 28 Nov 2016 11:33:51 -0000 Mailing-List: contact cygwin-cvs-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: cygwin-cvs-owner@cygwin.com Received: (qmail 112395 invoked by uid 9078); 28 Nov 2016 11:33:50 -0000 Date: Mon, 28 Nov 2016 11:33:00 -0000 Message-ID: <20161128113350.112392.qmail@sourceware.org> Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Corinna Vinschen To: cygwin-cvs@sourceware.org Subject: [newlib-cygwin] path_conv: When encountering a ".(/)+" sequence, skip *all* slashes X-Act-Checkin: newlib-cygwin X-Git-Author: Corinna Vinschen X-Git-Refname: refs/heads/master X-Git-Oldrev: a43e81e2330204cb37ee50363b4e1d9c1ec5c19a X-Git-Newrev: f0ae353a4fe00d3a33fdebaedc28ebac685463ad X-SW-Source: 2016-q4/txt/msg00040.txt.bz2 https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=f0ae353a4fe00d3a33fdebaedc28ebac685463ad commit f0ae353a4fe00d3a33fdebaedc28ebac685463ad Author: Corinna Vinschen Date: Mon Nov 28 12:33:40 2016 +0100 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 Diff: --- winsup/cygwin/path.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc index aaf1928..3d07ea1 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] == '.'