summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTimo Sirainen <cras@irssi.org>2002-01-11 05:47:52 +0000
committercras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564>2002-01-11 05:47:52 +0000
commit6d44620b4a0bcf52649dce18f3b42ecb39127ffc (patch)
tree1193ed86ab6b40b3a46680c6c0031e692de95315 /src
parent02f0574506cb80de9d24b257efe44d328b99e27e (diff)
downloadirssi-6d44620b4a0bcf52649dce18f3b42ecb39127ffc.zip
When commands were being parsed, the currectly active server should have been referenced, but the code was accidentally in subcommand parser not in the main one.. Also, the connection_lost wasn't checked after parsing the command and might have caused a glib error.
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2307 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src')
-rw-r--r--src/core/commands.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/core/commands.c b/src/core/commands.c
index 7893b1c1..928d73a0 100644
--- a/src/core/commands.c
+++ b/src/core/commands.c
@@ -313,7 +313,6 @@ void command_runsub(const char *cmd, const char *data,
subcmd = g_strconcat("command ", newcmd, NULL);
g_strdown(subcmd);
- if (server != NULL) server_ref(server);
if (!signal_emit(subcmd, 3, args, server, item)) {
defcmd = g_strdup_printf("default command %s", cmd);
if (!signal_emit(defcmd, 3, data, server, item)) {
@@ -322,7 +321,6 @@ void command_runsub(const char *cmd, const char *data,
}
g_free(defcmd);
}
- if (server != NULL) server_unref(server);
g_free(subcmd);
g_free(orig);
@@ -860,10 +858,12 @@ static void parse_command(const char *command, int expand_aliases,
oldcmd = current_command;
current_command = cmd+8;
- if (!signal_emit(cmd, 3, args, server, item)) {
+ if (server != NULL) server_ref(server);
+ if (!signal_emit(cmd, 3, args, server, item)) {
signal_emit_id(signal_default_command, 3,
command, server, item);
}
+ if (server != NULL) server_unref(server);
current_command = oldcmd;
g_free(cmd);