From 6b0aa28f2d8e1c1495b01bfc681ea3d5a5e9b6bc Mon Sep 17 00:00:00 2001 From: Andrew Pamment Date: Sat, 9 Apr 2016 12:54:50 +1000 Subject: [PATCH] Strip ansi from quotes --- mail_menu.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mail_menu.c b/mail_menu.c index 7865957..82dc04a 100644 --- a/mail_menu.c +++ b/mail_menu.c @@ -288,6 +288,9 @@ char *external_editor(int socket, struct user_record *user, char *to, char *from fprintf(fptr, "\r\n"); } else if (quote[i] == 0x1) { continue; + } else if (quote[i] == '\e' && quote[i + 1] == '[') { + while (strchr("ABCDEFGHIGJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz", quote[i]) == NULL) + i++; } else { fprintf(fptr, "%c", quote[i]); }