+ /* Parse username and password */
+ if (username && password && (NULL != (p = strchr(*hostname, '@'))))
+ {
+ *p++ = '\0';
+ *username = strdup_or_die(*hostname);
+ *hostname = strdup_or_die(p);
+
+ if (NULL != (p = strchr(*username, ':')))
+ {
+ *p++ = '\0';
+ *password = strdup_or_die(p);
+ }
+ freez(tmp);
+ }
+
+ /* Parse hostname and port */
+ p = *hostname;
+ if ((*p == '[') && (NULL == strchr(p, ']')))