Add some extra filters for escape chars

This commit is contained in:
Andrew Pamment 2017-03-26 20:49:54 +10:00
parent f6e068035d
commit 40d90085e3

View File

@ -45,7 +45,7 @@ char *message_editor() {
int z; int z;
int redraw; int redraw;
int old_top_of_screen = 0; int old_top_of_screen = 0;
int stage = 0;
position_x = 0; position_x = 0;
position_y = 0; position_y = 0;
@ -159,7 +159,17 @@ char *message_editor() {
} }
} }
} else if (ch.EventType == EVENT_CHARACTER) { } else if (ch.EventType == EVENT_CHARACTER) {
if (ch.chKeyPress == '\r' || strlen(line) >= 73) { if (stage == 1 && ch.chKeyPress == '[') {
stage = 2;
continue;
} else {
stage = 0;
continue;
}
if (ch.chKeyPress == 27) {
// got an escape that i shouldnt have
stage = 1;
} else if (ch.chKeyPress == '\r' || strlen(line) >= 73) {
if (strcasecmp(line, "/S") == 0) { if (strcasecmp(line, "/S") == 0) {
// save message // save message
body_len = 0; body_len = 0;