aboutsummaryrefslogtreecommitdiffstats
path: root/main/term.c
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2006-11-11 15:18:02 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2006-11-11 15:18:02 +0000
commita02854070268d64cfdad682dac43c00d3a630e07 (patch)
tree1100b9a44a160d9bd046c87c74a1c4da97239b87 /main/term.c
parentb87d94c31bdc998e41f7a6c3f64f41e2df35dfbe (diff)
Tweak the formatting of this new function to better conform to coding guidelines.
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@47492 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] = ' ';
+ }
}
}