From f7a577c3cdaeaeb831ac1a8b49564dc55cc919af Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Tue, 9 Aug 2022 09:55:13 -0400 Subject: [PATCH] Truncate username display to 25 characters so it doesn't overrun the column --- textclient/citadel.c | 2 +- textclient/commands.c | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/textclient/citadel.c b/textclient/citadel.c index c4d85b1f9..0bab0a566 100644 --- a/textclient/citadel.c +++ b/textclient/citadel.c @@ -160,7 +160,7 @@ void formout(CtdlIPC * ipc, char *name) void userlist(CtdlIPC * ipc, char *patn) { char buf[SIZ]; - char fl[SIZ]; + char fl[26]; // a buffer this small will prevent it overrunning the column struct tm tmbuf; time_t lc; int r; // IPC response code diff --git a/textclient/commands.c b/textclient/commands.c index 0c0cb99ba..5685d2f10 100644 --- a/textclient/commands.c +++ b/textclient/commands.c @@ -1346,15 +1346,15 @@ void stty_ctdl(int cmd) { if ((cmd == 0) || (cmd == 1)) { tcgetattr(0, &live); + + // Character-by-character input instead of line mode live.c_iflag = ISTRIP | IXON | IXANY; live.c_oflag = OPOST | ONLCR; live.c_lflag = ISIG | NOFLSH; + // Key bindings live.c_cc[VINTR] = 0; live.c_cc[VQUIT] = 0; - - // do we even need this stuff anymore? - // live.c_line=0; live.c_cc[VERASE] = 8; live.c_cc[VKILL] = 24; live.c_cc[VEOF] = 1; @@ -1363,9 +1363,11 @@ void stty_ctdl(int cmd) { live.c_cc[VSTART] = 0; tcsetattr(0, TCSADRAIN, &live); } + if (cmd == 2) { tcgetattr(0, &saved_settings); } + if (cmd == 3) { tcsetattr(0, TCSADRAIN, &saved_settings); } -- 2.39.2