mirror of
https://github.com/MidnightCommander/mc
synced 2025-03-12 10:53:23 +03:00
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:
parent
948753be0f
commit
6f0eacee73
@ -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';
|
||||
|
Loading…
x
Reference in New Issue
Block a user