diff options
author | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2008-01-11 01:15:29 +0800 |
---|---|---|
committer | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2008-01-11 01:15:29 +0800 |
commit | c1adbe09c64e8e252d0d1cfde149be2fd5f31db0 (patch) | |
tree | 79367e5539ff69e758ceed7b78619d9e8ae9c2d4 /mbbsd/io.c | |
parent | 0d0b63801e05a329e97aa1756d1920f9f47ca134 (diff) | |
download | pttbbs-c1adbe09c64e8e252d0d1cfde149be2fd5f31db0.tar pttbbs-c1adbe09c64e8e252d0d1cfde149be2fd5f31db0.tar.gz pttbbs-c1adbe09c64e8e252d0d1cfde149be2fd5f31db0.tar.bz2 pttbbs-c1adbe09c64e8e252d0d1cfde149be2fd5f31db0.tar.lz pttbbs-c1adbe09c64e8e252d0d1cfde149be2fd5f31db0.tar.xz pttbbs-c1adbe09c64e8e252d0d1cfde149be2fd5f31db0.tar.zst pttbbs-c1adbe09c64e8e252d0d1cfde149be2fd5f31db0.zip |
- bbslua: enable ^C to break <workaround>
- TODO: enable ungetch() someday.
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@3818 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/io.c')
-rw-r--r-- | mbbsd/io.c | 17 |
1 files changed, 17 insertions, 0 deletions
@@ -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: |