Strip ansi from quotes

This commit is contained in:
Andrew Pamment 2016-04-09 12:54:50 +10:00
parent 40251fd7e9
commit 6b0aa28f2d

View File

@ -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]);
}