networkaddress: Fix userinfo parsing in uris

The code that is checking the userinfo part was accidentally
given a pointer to the end of the userinfo, so it was not
checking the right portion of the string at all.
This commit is contained in:
Matthias Clasen 2012-04-08 10:15:29 -04:00
parent 2a1ea40920
commit 5632e9fc9c

View File

@ -475,15 +475,15 @@ _g_uri_parse_authority (const char *uri,
return FALSE;
start += 2;
p = strchr (start, '@');
if (p != NULL)
if (strchr (start, '@') != NULL)
{
/* Decode userinfo:
* userinfo = *( unreserved / pct-encoded / sub-delims / ":" )
* unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~"
* pct-encoded = "%" HEXDIG HEXDIG
*/
p = start;
while (1)
{
c = *p++;