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:
authorChristopher Faylor <me@cgf.cx>2000-04-19 01:28:45 +0400
committerChristopher Faylor <me@cgf.cx>2000-04-19 01:28:45 +0400
commitc845acffda0062fbde9c2aed8d278e913ca7c008 (patch)
tree77de68a8cb74eee9788bc8f3e06c2116f2a88274 /winsup/cygwin/dcrt0.cc
parente11ddfb02d7fcd85e263a0d1e96bcd5b0d4d788d (diff)
* dcrt0.cc (globify): Don't use \ quoting when apparently quoting a DOS path
spec.
Diffstat (limited to 'winsup/cygwin/dcrt0.cc')
-rw-r--r--winsup/cygwin/dcrt0.cc8
1 files changed, 7 insertions, 1 deletions
diff --git a/winsup/cygwin/dcrt0.cc b/winsup/cygwin/dcrt0.cc
index 5fd9cd4b1..5f0ad4958 100644
--- a/winsup/cygwin/dcrt0.cc
+++ b/winsup/cygwin/dcrt0.cc
@@ -308,6 +308,8 @@ globify (char *word, char **&argv, int &argc, int &argvlen)
int n = 0;
char *p, *s;
int dos_spec = isalpha(*word) && word[1] == ':' ? 1 : 0;
+ if (!dos_spec && isquote(*word) && word[1] && word[2])
+ dos_spec = isalpha(word[1]) && word[2] == ':' ? 1 : 0;
/* We'll need more space if there are quoting characters in
word. If that is the case, doubling the size of the
@@ -330,7 +332,11 @@ globify (char *word, char **&argv, int &argc, int &argvlen)
char quote = *s;
while (*++s && *s != quote)
{
- if (*s == '\\' && s[1] == quote)
+ if (*s != '\\')
+ /* nothing */;
+ else if (dos_spec)
+ *p++ = '\\';
+ else if (s[1] == quote || s[1] == '\\')
s++;
*p++ = '\\';
*p++ = *s;