diff options
author | LemonBoy <thatlemon@gmail.com> | 2015-10-02 11:25:30 +0200 |
---|---|---|
committer | LemonBoy <thatlemon@gmail.com> | 2015-10-02 11:25:30 +0200 |
commit | cfff402fe677316d286ce6663b8afeee4be95526 (patch) | |
tree | 43171e2d0014e2200226e24bd17919bf297a1cf6 /src/irc/core/irc-servers-setup.c | |
parent | fb6375c6f9c1191590420482aea634644aa228eb (diff) | |
download | irssi-cfff402fe677316d286ce6663b8afeee4be95526.zip |
Don't set the usermode field if blank
Fixes FS#919
Diffstat (limited to 'src/irc/core/irc-servers-setup.c')
-rw-r--r-- | src/irc/core/irc-servers-setup.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/irc/core/irc-servers-setup.c b/src/irc/core/irc-servers-setup.c index bf1d2ddf..f425b587 100644 --- a/src/irc/core/irc-servers-setup.c +++ b/src/irc/core/irc-servers-setup.c @@ -48,12 +48,18 @@ static void sig_server_setup_fill_reconn(IRC_SERVER_CONNECT_REC *conn, static void sig_server_setup_fill_connect(IRC_SERVER_CONNECT_REC *conn) { + const char *value; + if (!IS_IRC_SERVER_CONNECT(conn)) return; - conn->alternate_nick = *settings_get_str("alternate_nick") != '\0' ? - g_strdup(settings_get_str("alternate_nick")) : NULL; - conn->usermode = g_strdup(settings_get_str("usermode")); + value = settings_get_str("alternate_nick"); + conn->alternate_nick = (value != NULL && *value != '\0') ? + g_strdup(value) : NULL; + + value = settings_get_str("usermode"); + conn->usermode = (value != NULL && *value != '\0') ? + g_strdup(value) : NULL; } static void sig_server_setup_fill_chatnet(IRC_SERVER_CONNECT_REC *conn, |