From 259331e0b195573495f1e372af0373ad21a2d0e2 Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Tue, 24 Aug 2004 06:31:08 +0000 Subject: [PATCH] Allow '@' characters in nick. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@3287 dbcabf3a-b0e7-0310-adc4-f8d773084564 --- src/irc/core/irc.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/src/irc/core/irc.c b/src/irc/core/irc.c index 2c39a77a..e91fc738 100644 --- a/src/irc/core/irc.c +++ b/src/irc/core/irc.c @@ -321,6 +321,8 @@ static int irc_receive_line(SERVER_REC *server, char **str, int read_socket) static char *irc_parse_prefix(char *line, char **nick, char **address) { + char *p; + *nick = *address = NULL; /* : [["!" ] "@" ] SPACE */ @@ -328,18 +330,24 @@ static char *irc_parse_prefix(char *line, char **nick, char **address) if (*line != ':') return line; - *nick = ++line; + *nick = ++line; p = NULL; while (*line != '\0' && *line != ' ') { if (*line == '!' || *line == '@') { - *line++ = '\0'; - *address = line; - while (*line != '\0' && *line != ' ') - line++; - break; + p = line; + if (*line == '!') + break; } line++; } + if (p != NULL) { + line = p; + *line++ = '\0'; + *address = line; + while (*line != '\0' && *line != ' ') + line++; + } + if (*line == ' ') { *line++ = '\0'; while (*line == ' ') line++;