From 40d90085e3e182018261c2f97233ff9674284e75 Mon Sep 17 00:00:00 2001 From: Andrew Pamment Date: Sun, 26 Mar 2017 20:49:54 +1000 Subject: [PATCH] Add some extra filters for escape chars --- utils/magiedit/main.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/utils/magiedit/main.c b/utils/magiedit/main.c index e07566e..a5e5b72 100644 --- a/utils/magiedit/main.c +++ b/utils/magiedit/main.c @@ -45,7 +45,7 @@ char *message_editor() { int z; int redraw; int old_top_of_screen = 0; - + int stage = 0; position_x = 0; position_y = 0; @@ -159,7 +159,17 @@ char *message_editor() { } } } 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) { // save message body_len = 0;