mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-08 19:08:14 +00:00
Tweak the formatting of this new function to better conform to coding guidelines.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@47492 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
37
main/term.c
37
main/term.c
@@ -264,31 +264,28 @@ char *term_prompt(char *outbuf, const char *inbuf, int maxout)
|
|||||||
return outbuf;
|
return outbuf;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* filter escape sequences */
|
/* filter escape sequences */
|
||||||
void term_filter_escapes(char *line)
|
void term_filter_escapes(char *line)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i=0; i < strlen(line); i++) {
|
for (i = 0; i < strlen(line); i++) {
|
||||||
if (line[i] == ESC) {
|
if (line[i] != ESC)
|
||||||
if (line[i+1] == '\x5b') {
|
continue;
|
||||||
switch (line[i+2]) {
|
if (line[i + 1] == '\x5b') {
|
||||||
case '\x30':
|
switch (line[i + 2]) {
|
||||||
break;
|
case '\x30':
|
||||||
case '\x31':
|
case '\x31':
|
||||||
break;
|
case '\x33':
|
||||||
case '\x33':
|
break;
|
||||||
break;
|
default:
|
||||||
default:
|
/* replace ESC with a space */
|
||||||
/* replace ESC with a space */
|
line[i] = ' ';
|
||||||
line[i] = ' ';
|
}
|
||||||
}
|
} else {
|
||||||
} else {
|
/* replace ESC with a space */
|
||||||
/* replace ESC with a space */
|
line[i] = ' ';
|
||||||
line[i] = ' ';
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user