* dcrt0.cc (is_dos_path): New macro to recognize drive letter and UNC

DOS paths.
	(globify): Call is_dos_path instead of isdrive.
This commit is contained in:
Corinna Vinschen 2012-01-27 09:28:38 +00:00
parent 4f415392a7
commit deeffc5036
2 changed files with 14 additions and 5 deletions

View File

@ -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 * dcrt0.cc (is_dos_path): New macro to recognize drive letter and UNC
0. DOS paths.
(globify): Call is_dos_path instead of isdrive.
2012-01-26 Christopher Faylor <me.cygwin2012@cgf.cx> 2012-01-26 Christopher Faylor <me.cygwin2012@cgf.cx>

View File

@ -194,6 +194,14 @@ quoted (char *cmd, int winshell)
/* Perform a glob on word if it contains wildcard characters. /* Perform a glob on word if it contains wildcard characters.
Also quote every character between quotes to force glob to Also quote every character between quotes to force glob to
treat the characters literally. */ 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 static int __stdcall
globify (char *word, char **&argv, int &argc, int &argvlen) 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; int n = 0;
char *p, *s; char *p, *s;
int dos_spec = isdrive (word); int dos_spec = is_dos_path (word);
if (!dos_spec && isquote (*word) && word[1] && word[2]) 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 /* We'll need more space if there are quoting characters in
word. If that is the case, doubling the size of the word. If that is the case, doubling the size of the