diff options
author | Sébastien Helleu <flashcode@flashtux.org> | 2015-11-24 20:26:06 +0100 |
---|---|---|
committer | Sébastien Helleu <flashcode@flashtux.org> | 2015-11-24 20:26:06 +0100 |
commit | 4fca6c58c8d817363a20da6691c1e9705f6234f1 (patch) | |
tree | 1ba3a807be7f22dece1136dde07bc26779ebc5e0 /src/plugins/irc/irc-server.c | |
parent | 9e9dd27bb3240731a33a431e5679dd974cd0b1c0 (diff) | |
download | weechat-4fca6c58c8d817363a20da6691c1e9705f6234f1.zip |
irc: add a condition for colon before the password in PASS message (issue #602)
Some weird IRC servers may refuse a PASS command with a colon, so we
send a colon only if the password contains spaces or begins with a
colon.
Diffstat (limited to 'src/plugins/irc/irc-server.c')
-rw-r--r-- | src/plugins/irc/irc-server.c | 8 |
1 files changed, 7 insertions, 1 deletions
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) { |