Skip to content

Commit 02bbbe8

Browse files
authored
fix printing of join/part messages when cdef is a substring of the actual channel name (#99)
1 parent 4d0d71f commit 02bbbe8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

kirc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,7 @@ static void paramPrintNick(struct Param * p) {
485485

486486
static void paramPrintPart(struct Param * p) {
487487
printf("%*s<-- \x1b[34;1m%s\x1b[0m", p->nicklen - 3, "", p->nickname);
488-
if (p->channel != NULL && strstr(p->channel, cdef) == NULL)
488+
if (p->channel != NULL && strcmp(p->channel+1, cdef))
489489
printf(" [\x1b[33m%s\x1b[0m] ", p->channel);
490490
}
491491

@@ -495,7 +495,7 @@ static void paramPrintQuit(struct Param * p) {
495495

496496
static void paramPrintJoin(struct Param * p) {
497497
printf("%*s--> \x1b[32;1m%s\x1b[0m", p->nicklen - 3, "", p->nickname);
498-
if (p->channel != NULL && strstr(p->channel, cdef) == NULL)
498+
if (p->channel != NULL && strcmp(p->channel+1, cdef))
499499
printf(" [\x1b[33m%s\x1b[0m] ", p->channel);
500500
}
501501

0 commit comments

Comments
 (0)