Skip to content

Commit 78731a9

Browse files
authored
show the params when printing unknown commands (#91)
1 parent a232bba commit 78731a9

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

kirc.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ struct Param {
4242
char * nickname;
4343
char * command;
4444
char * channel;
45+
char * params;
4546
size_t offset;
4647
size_t maxcols;
4748
int nicklen;
@@ -544,6 +545,8 @@ static void paramPrintChan(struct Param * p) {
544545
if (strnlen(p->nickname, MSG_MAX) <= p->nicklen)
545546
s = p->nicklen - strnlen(p->nickname, MSG_MAX);
546547
printf("%*s\x1b[33;1m%-.*s\x1b[0m ", s, "", p->nicklen, p->nickname);
548+
if (p->params)
549+
printf(p->params);
547550
}
548551

549552
static void rawParser(char * string) {
@@ -568,6 +571,7 @@ static void rawParser(char * string) {
568571
p.nickname = strtok(p.prefix, "!");
569572
p.command = strtok(p.suffix, "#& ");
570573
p.channel = strtok(NULL, " \r");
574+
p.params = strtok(NULL, ":\r");
571575
p.maxcols = getColumns(STDIN_FILENO, STDOUT_FILENO);
572576
p.nicklen = (p.maxcols / 3 > NIC_MAX ? NIC_MAX : p.maxcols / 3);
573577
p.offset = 0;

0 commit comments

Comments
 (0)