aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorB. Watson <urchlay@slackware.uk>2026-03-15 04:24:26 -0400
committerB. Watson <urchlay@slackware.uk>2026-03-15 04:24:26 -0400
commitffebfdcc4f37d905ccb1a21105e2998b5af9bc55 (patch)
tree156000413d1237aba1bf3a91d1a4404ee972c6c2 /src
parent5778ecac27a763bc19ef52b5b99c8cc06bb0fa7b (diff)
downloadfujinet-chat-ffebfdcc4f37d905ccb1a21105e2998b5af9bc55.tar.gz
Allow using the 240th character of the edit nox. And alert when trying to type past the end.pre-alpha
Diffstat (limited to 'src')
-rw-r--r--src/edbox.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/edbox.c b/src/edbox.c
index e3a1e85..b70ae2a 100644
--- a/src/edbox.c
+++ b/src/edbox.c
@@ -55,13 +55,19 @@ void edbox_hide(void) {
etc). not sure if this is more or less annoying than just
refusing to accept more input until Return is pressed. */
void edbox_putc(char c) {
+ extern void __fastcall__ bell(void);
+
if(!c)
return; /* no inserting nulls */
- if((c != CH_EOL) && (edbox_pos == EDBOX_SIZE - 1))
- return;
+
memmove(edit_box + edbox_pos + 1, edit_box + edbox_pos, EDBOX_SIZE - edbox_pos - 1);
- edit_box[edbox_pos++] = c;
- edbox_len++;
+ edit_box[edbox_pos] = c;
+ if(edbox_pos < EDBOX_SIZE - 1) {
+ edbox_pos++;
+ edbox_len++;
+ } else {
+ bell();
+ }
}
static void fake_keystroke(char c) {