From: Kamil Dudka Date: Sun, 30 Jun 2013 17:51:16 +0000 (+0200) Subject: url: restore the functionality of 'curl -u :' X-Git-Tag: curl-7_32_0~126 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=abca89aaa0fb208cfaf4ead6692014c4e553388a;p=thirdparty%2Fcurl.git 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 --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index db9ef744a1..db5323bb8c 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -28,6 +28,7 @@ This release includes the following bugfixes: o c-ares: improve error message on failed resolve [4] o printf: make sure %x are treated unsigned o formpost: better random boundaries [5] + o url: restore the functionality of 'curl -u :' [6] This release includes the following known bugs: @@ -48,3 +49,4 @@ References to bug reports and discussions on issues: [3] = http://curl.haxx.se/bug/view.cgi?id=1249 [4] = http://curl.haxx.se/bug/view.cgi?id=1191 [5] = http://curl.haxx.se/bug/view.cgi?id=1251 + [6] = http://curl.haxx.se/mail/archive-2013-06/0052.html diff --git a/lib/url.c b/lib/url.c index e1c9dffe29..6ecf7b53b8 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; }