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>2012-01-27 13:28:38 +0400
committerCorinna Vinschen <corinna@vinschen.de>2012-01-27 13:28:38 +0400
commitdeeffc5036c2a88c6e36b5c409714ff65e30b6e9 (patch)
tree9aade63535a5bd61db00b51a1629c674d26d4cdf /winsup/cygwin/dcrt0.cc
parent4f415392a79b975ca874e4542fd0d55509a9a103 (diff)
* dcrt0.cc (is_dos_path): New macro to recognize drive letter and UNC
DOS paths. (globify): Call is_dos_path instead of isdrive.
Diffstat (limited to 'winsup/cygwin/dcrt0.cc')
-rw-r--r--winsup/cygwin/dcrt0.cc12
1 files changed, 10 insertions, 2 deletions
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