diff options
author | Sebastien Helleu <flashcode@flashtux.org> | 2003-10-11 17:38:38 +0000 |
---|---|---|
committer | Sebastien Helleu <flashcode@flashtux.org> | 2003-10-11 17:38:38 +0000 |
commit | 67428a1aafd991fe41a52a0747c73d8444cd6031 (patch) | |
tree | a57ef7b4231ec49924840300945cb7ebec48955b | |
parent | 384b8780b061a1c635e6e2f44969304ae31ad7ae (diff) | |
download | weechat-67428a1aafd991fe41a52a0747c73d8444cd6031.zip |
Fixed crash when entering text without any server connection
-rw-r--r-- | ChangeLog | 1 | ||||
-rw-r--r-- | src/command.c | 7 | ||||
-rw-r--r-- | weechat/ChangeLog | 1 | ||||
-rw-r--r-- | weechat/src/command.c | 7 |
4 files changed, 10 insertions, 6 deletions
@@ -5,6 +5,7 @@ ChangeLog - 2003-10-11 Version 0.0.3 (under dev!): + * fixed crash when entering text without any server connection * fixed display bug (text was blinking when scrolling) * new IRC command: /stats, /service, /squit, /motd, /lusers, /links, /time, /trace, /admin, /info, /servlist, /squery, /who, /whowas, /die, /summon, diff --git a/src/command.c b/src/command.c index 19d1045dd..b11aafdc7 100644 --- a/src/command.c +++ b/src/command.c @@ -675,7 +675,7 @@ user_command (t_irc_server *server, char *command) { t_irc_nick *ptr_nick; - if ((!command) || (command[0] == '\r') || (command[0] == '\n')) + if ((!command) || (!command[0]) || (command[0] == '\r') || (command[0] == '\n')) return; if ((command[0] == '/') && (command[1] != '/')) { @@ -686,7 +686,7 @@ user_command (t_irc_server *server, char *command) { if ((command[0] == '/') && (command[1] == '/')) command++; - if (!WIN_IS_SERVER(gui_current_window)) + if (server && (!WIN_IS_SERVER(gui_current_window))) { server_sendf (server, "PRIVMSG %s :%s\r\n", CHANNEL(gui_current_window)->name, @@ -725,7 +725,8 @@ user_command (t_irc_server *server, char *command) } } else - gui_printf (server->window, _("This window is not a channel!\n")); + gui_printf ((server) ? server->window : NULL, + _("This window is not a channel!\n")); } } diff --git a/weechat/ChangeLog b/weechat/ChangeLog index 5ac152c76..92f9b6968 100644 --- a/weechat/ChangeLog +++ b/weechat/ChangeLog @@ -5,6 +5,7 @@ ChangeLog - 2003-10-11 Version 0.0.3 (under dev!): + * fixed crash when entering text without any server connection * fixed display bug (text was blinking when scrolling) * new IRC command: /stats, /service, /squit, /motd, /lusers, /links, /time, /trace, /admin, /info, /servlist, /squery, /who, /whowas, /die, /summon, diff --git a/weechat/src/command.c b/weechat/src/command.c index 19d1045dd..b11aafdc7 100644 --- a/weechat/src/command.c +++ b/weechat/src/command.c @@ -675,7 +675,7 @@ user_command (t_irc_server *server, char *command) { t_irc_nick *ptr_nick; - if ((!command) || (command[0] == '\r') || (command[0] == '\n')) + if ((!command) || (!command[0]) || (command[0] == '\r') || (command[0] == '\n')) return; if ((command[0] == '/') && (command[1] != '/')) { @@ -686,7 +686,7 @@ user_command (t_irc_server *server, char *command) { if ((command[0] == '/') && (command[1] == '/')) command++; - if (!WIN_IS_SERVER(gui_current_window)) + if (server && (!WIN_IS_SERVER(gui_current_window))) { server_sendf (server, "PRIVMSG %s :%s\r\n", CHANNEL(gui_current_window)->name, @@ -725,7 +725,8 @@ user_command (t_irc_server *server, char *command) } } else - gui_printf (server->window, _("This window is not a channel!\n")); + gui_printf ((server) ? server->window : NULL, + _("This window is not a channel!\n")); } } |