Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
Fix msys_p2w() tweak for path lists
Browse files Browse the repository at this point in the history
This commit fixes the path list heuristic modified by the previous
commit.  The previous commit modified the heuristic to leave all
strings that do not start with "." nor "/" as is.  But this is wrong:
Those strings must not be considered path lists, but they might need
to be modified nonetheless, for example if they contain arguments with
assignments, like git's "--template=/path/to/tmpl".
  • Loading branch information
sprohaska committed May 12, 2008
1 parent 50c0dc5 commit cb1fa7c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
Binary file modified bin/msys-1.0.dll
Binary file not shown.
@@ -1,4 +1,4 @@
From 5f10e96b8fe8330c012369a53a987e12ed947f37 Mon Sep 17 00:00:00 2001
From 446c37bf8f4e08dfca20fedee8de3f5dfe1b32ef Mon Sep 17 00:00:00 2001
From: Steffen Prohaska <prohaska@zib.de>
Date: Sat, 10 May 2008 20:30:09 +0200
Subject: [PATCH] p2w for msysgit: Check if string starts with "." or "/" before considering it a pathlist
Expand All @@ -8,18 +8,18 @@ Subject: [PATCH] p2w for msysgit: Check if string starts with "." or "/" before
1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/src/winsup/cygwin/path.cc b/src/winsup/cygwin/path.cc
index 59827e3..7969b6e 100644
index 59827e3..8d73b09 100644
--- a/src/winsup/cygwin/path.cc
+++ b/src/winsup/cygwin/path.cc
@@ -3144,6 +3144,8 @@ msys_p2w (char const * const path)
)
// Prevent git's :/message syntax from beeing modified.
|| (strlen (spath) > 1 && spath[0] == ':' && spath[1] == '/')
+ // Prevent modification if string does not start with "." or "/".
+ || (strchr ("./", spath[0]) == 0)
)
{
debug_printf("returning: %s", path);
@@ -3157,6 +3157,8 @@ msys_p2w (char const * const path)
// remember that this is a recursive routine.
//
&& (strchr ("-\"\'", spath[0]) == 0)
+ // Prevent modification if string does not start with "." or "/".
+ && (strchr ("./", spath[0]) > 0)
//
// Prevent ``foo:echo /bar/baz'' from being considered a path list.
//
--
1.5.5.1015.g9d258

0 comments on commit cb1fa7c

Please sign in to comment.