summaryrefslogtreecommitdiffstats
path: root/mbbsd/io.c
diff options
context:
space:
mode:
Diffstat (limited to 'mbbsd/io.c')
-rw-r--r--mbbsd/io.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/mbbsd/io.c b/mbbsd/io.c
index 64d5b1a1..cd2388ec 100644
--- a/mbbsd/io.c
+++ b/mbbsd/io.c
@@ -778,6 +778,14 @@ oldgetdata(int line, int col, const char *prompt, char *buf, int len, int echo)
len--;
clen = 0;
while ((ch = igetch()) != '\r') {
+ if (ch == Ctrl('C'))
+ {
+ // abort
+ clen = 0;
+ if (len > 1)
+ buf[1] = ch; // workaround for BBS-Lua
+ break;
+ }
if (ch == '\177' || ch == Ctrl('H')) {
if (!clen) {
bell();
@@ -822,6 +830,15 @@ oldgetdata(int line, int col, const char *prompt, char *buf, int len, int echo)
if ((ch = igetch()) == '\r')
break;
+ if (ch == Ctrl('C'))
+ {
+ // abort
+ clen = currchar = 0;
+ if (len > 1)
+ buf[1] = ch; // workaround for BBS-Lua
+ break;
+ }
+
switch (ch) {
case Ctrl('A'):
case KEY_HOME: