summaryrefslogtreecommitdiff
path: root/src/irc/core/irc.c
diff options
context:
space:
mode:
authorTimo Sirainen <cras@irssi.org>2004-08-24 06:31:08 +0000
committercras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564>2004-08-24 06:31:08 +0000
commit259331e0b195573495f1e372af0373ad21a2d0e2 (patch)
tree4b865eb75ab6b22de1148e04ecaca18303fb8582 /src/irc/core/irc.c
parent685b887e8e18ca8471dc9833e415c985dbb6befe (diff)
downloadirssi-259331e0b195573495f1e372af0373ad21a2d0e2.zip
Allow '@' characters in nick.
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@3287 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/irc/core/irc.c')
-rw-r--r--src/irc/core/irc.c20
1 files 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;
/* :<nick> [["!" <user>] "@" <host>] 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++;