summaryrefslogtreecommitdiff
path: root/src/core/servers.c
diff options
context:
space:
mode:
authorTimo Sirainen <cras@irssi.org>2000-11-30 22:58:45 +0000
committercras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564>2000-11-30 22:58:45 +0000
commita01275959deb5c8936bf90a3c51e4f9771a59819 (patch)
tree34f04f6583ecf932f0c7f83d3d2cea6958c57ebb /src/core/servers.c
parent2ea411093ad0e6808cac86caf9dffd6f36d36c0f (diff)
downloadirssi-a01275959deb5c8936bf90a3c51e4f9771a59819.zip
cmd_options_get_server() : allow NULL cmd argument
eval_special_string() : if any of the commands separated with ; used the arguments ($0, $1, etc.) don't anymore append all the arguments after other commands. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@903 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/core/servers.c')
-rw-r--r--src/core/servers.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/core/servers.c b/src/core/servers.c
index 9ec53902..fa9e6666 100644
--- a/src/core/servers.c
+++ b/src/core/servers.c
@@ -429,12 +429,14 @@ SERVER_REC *cmd_options_get_server(const char *cmd,
/* get all the options, then remove the known ones. there should
be only one left - the server tag. */
list = hashtable_get_keys(optlist);
- for (tmp = list; tmp != NULL; tmp = next) {
- char *option = tmp->data;
- next = tmp->next;
+ if (cmd != NULL) {
+ for (tmp = list; tmp != NULL; tmp = next) {
+ char *option = tmp->data;
+ next = tmp->next;
- if (command_have_option(cmd, option))
- list = g_slist_remove(list, option);
+ if (command_have_option(cmd, option))
+ list = g_slist_remove(list, option);
+ }
}
if (list == NULL)