aboutsummaryrefslogtreecommitdiffstats
path: root/main/term.c
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2006-11-11 15:22:08 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2006-11-11 15:22:08 +0000
commit3eb38fa3bf58ae3de6bf149675ffebf4b6df3595 (patch)
treee0523ad82b49a6557536f8b68b2032708ae5ff68 /main/term.c
parentd1557a9c08663da3017ca3ed3c5bbfe9660551db (diff)
Merged revisions 47492 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r47492 | russell | 2006-11-11 10:18:02 -0500 (Sat, 11 Nov 2006) | 2 lines Tweak the formatting of this new function to better conform to coding guidelines. ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@47493 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/term.c')
-rw-r--r--main/term.c37
1 files changed, 17 insertions, 20 deletions
diff --git a/main/term.c b/main/term.c
index e92a27077..bdafa49e2 100644
--- a/main/term.c
+++ b/main/term.c
@@ -264,31 +264,28 @@ 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] = ' ';
- }
- }
+ for (i = 0; i < strlen(line); i++) {
+ if (line[i] != ESC)
+ continue;
+ if (line[i + 1] == '\x5b') {
+ switch (line[i + 2]) {
+ case '\x30':
+ case '\x31':
+ case '\x33':
+ break;
+ default:
+ /* replace ESC with a space */
+ line[i] = ' ';
+ }
+ } else {
+ /* replace ESC with a space */
+ line[i] = ' ';
+ }
}
}