aboutsummaryrefslogtreecommitdiff
path: root/lib/url.c
diff options
context:
space:
mode:
authorKamil Dudka <kdudka@redhat.com>2013-06-30 19:51:16 +0200
committerKamil Dudka <kdudka@redhat.com>2013-06-30 20:13:14 +0200
commitabca89aaa0fb208cfaf4ead6692014c4e553388a (patch)
tree1d612d70e0077d7b149e196ce185b173a74bb047 /lib/url.c
parentd689376cb0916cc9517c84f349eb321d424981e8 (diff)
url: restore the functionality of 'curl -u :'
This commit fixes a regression introduced in fddb7b44a79d78e05043e1c97e069308b6b85f79. Reported by: Markus Moeller Bug: http://curl.haxx.se/mail/archive-2013-06/0052.html
Diffstat (limited to 'lib/url.c')
-rw-r--r--lib/url.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/url.c b/lib/url.c
index e1c9dffe2..6ecf7b53b 100644
--- a/lib/url.c
+++ b/lib/url.c
@@ -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;
}