mirror of
https://github.com/curl/curl.git
synced 2026-04-22 12:32:13 +03:00
url: restore the functionality of 'curl -u :'
This commit fixes a regression introduced in
fddb7b44a7.
Reported by: Markus Moeller
Bug: http://curl.haxx.se/mail/archive-2013-06/0052.html
This commit is contained in:
parent
d689376cb0
commit
abca89aaa0
2 changed files with 9 additions and 0 deletions
|
|
@ -318,6 +318,13 @@ static CURLcode setstropt_userpwd(char *option, char **userp, char **passwdp,
|
|||
if(!result) {
|
||||
/* Store the username part of option if required */
|
||||
if(userp) {
|
||||
if(!user && option && option[0] == ':') {
|
||||
/* Allocate an empty string instead of returning NULL as user name */
|
||||
user = strdup("");
|
||||
if(!user)
|
||||
result = CURLE_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
Curl_safefree(*userp);
|
||||
*userp = user;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue