Merged revisions 47492 via svnmerge from
authorRussell Bryant <russell@russellbryant.com>
Sat, 11 Nov 2006 15:22:08 +0000 (15:22 +0000)
committerRussell Bryant <russell@russellbryant.com>
Sat, 11 Nov 2006 15:22:08 +0000 (15:22 +0000)
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: https://origsvn.digium.com/svn/asterisk/trunk@47493 65c4cc65-6c06-0410-ace0-fbb531ad65f3

main/term.c

index e92a270..bdafa49 100644 (file)
@@ -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] = ' ';
+               }
         }
  }