From 6f0eacee73906d51f49ede6c95d557b451881ff0 Mon Sep 17 00:00:00 2001 From: Andrew Borodin Date: Mon, 18 Jun 2012 20:56:19 +0400 Subject: [PATCH] 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 --- lib/widget/input.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/widget/input.c b/lib/widget/input.c index 89acf08e8..c2ec0cbaf 100644 --- a/lib/widget/input.c +++ b/lib/widget/input.c @@ -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';