diff options
Diffstat (limited to '')
-rw-r--r-- | kirc.c | 15 | ||||
-rw-r--r-- | kirc.h | 2 |
2 files changed, 9 insertions, 8 deletions
@@ -485,9 +485,10 @@ static int edit(state l) } char seq[3]; switch (c) { + case 10: case 13: edit_enter(); - return 1; /* enter */ + return 1; /* enter */ /* ctrl+j */ case 3: errno = EAGAIN; return -1; /* ctrl-c */ @@ -535,7 +536,7 @@ static int edit(state l) history_len = HIS_MAX - 1; history_wrap = 0; } - return -1; + return 0; } edit_delete(l); return 0; @@ -750,7 +751,7 @@ static int connection_initialize(void) return 0; } -static void message_wrap(param p, const char *nick) +static void message_wrap(param p) { if (!p->message) { return; @@ -1276,12 +1277,12 @@ static void raw_parser(char *string) }if ((!memcmp(p.command, "PRIVMSG", sizeof("PRIVMSG") - 1)) || (!memcmp(p.command, "NOTICE", sizeof("NOTICE") - 1))) { filter_colors(p.message); /* this can be slow if -f is passed to kirc */ param_print_private(&p); - message_wrap(&p, nick); + message_wrap(&p); printf("\x1b[0m\r\n"); return; } param_print_channel(&p); - message_wrap(&p, nick); + message_wrap(&p); printf("\x1b[0m\r\n"); } @@ -1724,7 +1725,7 @@ static inline void chan_privmsg_command(state l) } } -static void handle_user_input(state l, const char *nick) +static void handle_user_input(state l) { if (*l->buf == '\0') { return; @@ -2024,7 +2025,7 @@ int main(int argc, char **argv) editReturnFlag = edit(&l); if (editReturnFlag > 0) { history_add(l.buf); - handle_user_input(&l, nick); + handle_user_input(&l); state_reset(&l); } else if (editReturnFlag < 0) { puts("\r\n"); @@ -12,7 +12,7 @@ #define TESTCHARS "\xe1\xbb\xa4" #define MSG_MAX 512 /* irc rfc says lines are 512 char's max, but servers can accept more */ #define CHA_MAX 200 -#define WRAP_LEN 22 +#define WRAP_LEN 30 #define ABUF_LEN (sizeof("\r") - 1 + CHA_MAX + sizeof("> ") - 1 + MSG_MAX + sizeof("\x1b[0K") - 1 + 32 + 1) /* this is as big as the ab buffer can get */ #define HIS_MAX 100 |