diff options
author | Daniel Stenberg <daniel@haxx.se> | 2001-08-08 07:35:57 +0000 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2001-08-08 07:35:57 +0000 |
commit | 59ab21ed078cb165289b01de9af7c153050c58fd (patch) | |
tree | ce8909082f3fd849fd4e9635eed1f95d88aaaddb /src | |
parent | edec65246ab26aa9da6cad04a805c6e40b040201 (diff) |
The file name given to -E can now contain drive letters on windows, if they
start the file name as in 'X:\' where X is any letter. The colon otherwise
normally separate the file name from the password.
Diffstat (limited to 'src')
-rw-r--r-- | src/main.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/main.c b/src/main.c index 7e2ac4669..9c59ab3d4 100644 --- a/src/main.c +++ b/src/main.c @@ -899,7 +899,23 @@ static ParameterError getparameter(char *flag, /* f or -long-flag */ } else { char *ptr = strchr(nextarg, ':'); - if(ptr) { + /* Since we live in a world of weirdness and confusion, the win32 + dudes can use : when using drive letters and thus + c:\file:password needs to work. In order not to break + compatibility, we still use : as separator, but we try to detect + when it is used for a file name! On windows. */ +#ifdef WIN32 + if(ptr && + (ptr == &nextarg[1]) && + (nextarg[2] == '\\') && + (isalpha((int)nextarg[0])) ) + /* colon in the second column, followed by a backslash, and the + first character is an alphabetic letter: + + this is a drive letter colon */ + ptr = strchr(&nextarg[3], ':'); /* find the next one instead */ +#endif + if(ptr) { /* we have a password too */ *ptr=0; ptr++; |