Ticket #2833: url with port was stored wrong in history.

"sh://admin@192.168.1.119:55522" was stored as
"sh://admin@192.168.1.119@192.168.1.119".

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
Andrew Borodin 2012-06-18 20:56:19 +04:00
parent 948753be0f
commit 6f0eacee73

View File

@ -227,6 +227,11 @@ input_history_strip_password (char *url)
else
colon = strchr (url, ':');
/* if 'colon' before 'at', 'colon' delimits user and password: user:password@host */
/* if 'colon' after 'at', 'colon' delimits host and port: user@host:port */
if (colon != NULL && colon > at)
colon = NULL;
if (colon == NULL)
return g_strdup (url);
*colon = '\0';