diff options
author | Timo Sirainen <cras@irssi.org> | 2002-02-06 23:37:03 +0000 |
---|---|---|
committer | cras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564> | 2002-02-06 23:37:03 +0000 |
commit | a3ccfb08d4327a623bccd50ba38f84194245d3cc (patch) | |
tree | 6c495e4c0bb38da987be6a29f4b00e11e78c9a28 /src/fe-common | |
parent | f8114c834f8228c39bd0a3ea88a6edff749a4f4a (diff) | |
download | irssi-a3ccfb08d4327a623bccd50ba38f84194245d3cc.zip |
Still some event_received() fixes.
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2397 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/fe-common')
-rw-r--r-- | src/fe-common/irc/fe-events-numeric.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/fe-common/irc/fe-events-numeric.c b/src/fe-common/irc/fe-events-numeric.c index 3b5437d1..e81379bd 100644 --- a/src/fe-common/irc/fe-events-numeric.c +++ b/src/fe-common/irc/fe-events-numeric.c @@ -760,12 +760,19 @@ static void event_received(IRC_SERVER_REC *server, const char *data) ptr = strchr(data, ' '); if (ptr == NULL) return; + ptr++; /* param1 param2 ... :last parameter */ - args = g_strdup(ptr); - ptr = strstr(args, " :"); - if (ptr != NULL) - g_memmove(ptr+1, ptr+2, strlen(ptr+1)); + if (*ptr == ':') { + /* only one parameter */ + args = g_strdup(ptr+1); + } else { + args = g_strdup(ptr); + ptr = strstr(args, " :"); + if (ptr != NULL) + g_memmove(ptr+1, ptr+2, strlen(ptr+1)); + } + printtext(server, NULL, MSGLEVEL_CRAP, "%s", args); g_free(args); } |