diff --git a/ChangeLog.asciidoc b/ChangeLog.asciidoc index 06b83b6a4..3dcf80c21 100644 --- a/ChangeLog.asciidoc +++ b/ChangeLog.asciidoc @@ -46,7 +46,8 @@ https://weechat.org/files/releasenotes/ReleaseNotes-devel.html[release notes] * core: fix truncated messages after a word with a length of zero on screen (for example a zero width space: U+200B) (bug #40985, issue #502) * api: fix handle of invalid escape in function string_convert_escaped_chars() -* irc: add a missing colon before the password in PASS message (issue #602) +* irc: add a missing colon before the password in PASS message, if the password + has spaces or begins with a colon (issue #602) * irc: fix charset decoding in incoming private messages (issue #520) * irc: display the arrow before server name in raw buffer * irc: fix display of messages sent to server in raw buffer diff --git a/src/plugins/irc/irc-server.c b/src/plugins/irc/irc-server.c index 678236200..b81434787 100644 --- a/src/plugins/irc/irc-server.c +++ b/src/plugins/irc/irc-server.c @@ -3328,7 +3328,13 @@ irc_server_login (struct t_irc_server *server) server, IRC_SERVER_OPTION_CAPABILITIES); if (password && password[0]) - irc_server_sendf (server, 0, NULL, "PASS :%s", password); + { + irc_server_sendf ( + server, 0, NULL, + "PASS %s%s", + ((password[0] == ':') || (strchr (password, ' '))) ? ":" : "", + password); + } if (!server->nick) {