From b87d94c31bdc998e41f7a6c3f64f41e2df35dfbe Mon Sep 17 00:00:00 2001 From: mogorman Date: Sat, 11 Nov 2006 02:04:28 +0000 Subject: woohoo safe out put! git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@47490 f38db490-d61c-443f-a65b-d21fe96a405b --- main/term.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'main/term.c') diff --git a/main/term.c b/main/term.c index a38399eda..e92a27077 100644 --- a/main/term.c +++ b/main/term.c @@ -264,6 +264,34 @@ char *term_prompt(char *outbuf, const char *inbuf, int maxout) return outbuf; } + +/* filter escape sequences */ +void term_filter_escapes(char *line) + { + int i; + + for (i=0; i < strlen(line); i++) { + if (line[i] == ESC) { + if (line[i+1] == '\x5b') { + switch (line[i+2]) { + case '\x30': + break; + case '\x31': + break; + case '\x33': + break; + default: + /* replace ESC with a space */ + line[i] = ' '; + } + } else { + /* replace ESC with a space */ + line[i] = ' '; + } + } + } + } + char *term_prep(void) { return prepdata; -- cgit v1.2.3