summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--winsup/cygwin/ChangeLog7
-rw-r--r--winsup/cygwin/dcrt0.cc12
2 files changed, 14 insertions, 5 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 9003621fc..b51c18ea2 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,7 +1,8 @@
-2012-01-26 Christopher Faylor <me.cygwin2012@cgf.cx>
+2012-01-27 Corinna Vinschen <corinna@vinschen.de>
- * sigproc.cc (child_info::retry_count): Actually that should have been
- 0.
+ * dcrt0.cc (is_dos_path): New macro to recognize drive letter and UNC
+ DOS paths.
+ (globify): Call is_dos_path instead of isdrive.
2012-01-26 Christopher Faylor <me.cygwin2012@cgf.cx>
diff --git a/winsup/cygwin/dcrt0.cc b/winsup/cygwin/dcrt0.cc
index 827ab143d..5cee5f16d 100644
--- a/winsup/cygwin/dcrt0.cc
+++ b/winsup/cygwin/dcrt0.cc
@@ -194,6 +194,14 @@ quoted (char *cmd, int winshell)
/* Perform a glob on word if it contains wildcard characters.
Also quote every character between quotes to force glob to
treat the characters literally. */
+
+/* Either X:[...] or \\server\[...] */
+#define is_dos_path(s) (isdrive(s) \
+ || ((s)[0] == '\\' \
+ && (s)[1] == '\\' \
+ && isalpha ((s)[2]) \
+ && strchr ((s) + 3, '\\')))
+
static int __stdcall
globify (char *word, char **&argv, int &argc, int &argvlen)
{
@@ -202,9 +210,9 @@ globify (char *word, char **&argv, int &argc, int &argvlen)
int n = 0;
char *p, *s;
- int dos_spec = isdrive (word);
+ int dos_spec = is_dos_path (word);
if (!dos_spec && isquote (*word) && word[1] && word[2])
- dos_spec = isdrive (word + 1);
+ dos_spec = is_dos_path (word + 1);
/* We'll need more space if there are quoting characters in
word. If that is the case, doubling the size of the