Whitespace / formatting / bracket cleanup.
[oweals/busybox.git] / cmdedit.c
index 09791892583a01e862e081e73fd9fcef5db0437b..272d22fc037595e41bb637e2f09b155d2e3151f1 100644 (file)
--- a/cmdedit.c
+++ b/cmdedit.c
 
 //#define TEST
 
+#include <stdio.h>
+#include <errno.h>
+#include <unistd.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/ioctl.h>
+#include <ctype.h>
+#include <signal.h>
+#include <limits.h>
 
 #ifndef TEST
 
 
 #else
 
-//#define BB_FEATURE_NONPRINTABLE_INVERSE_PUT
-//#define BB_FEATURE_BASH_STYLE_PROMT
+#define BB_FEATURE_SH_COMMAND_EDITING
+#define BB_FEATURE_SH_TAB_COMPLETION
+#define BB_FEATURE_SH_USERNAME_COMPLETION
+#define BB_FEATURE_NONPRINTABLE_INVERSE_PUT
+#define BB_FEATURE_BASH_STYLE_PROMT
+#define BB_FEATURE_CLEAN_UP
 
-#define TRUE  1
-#define FALSE 0
 #define D(x)  x
 
 #endif                                                 /* TEST */
 
+#ifdef BB_FEATURE_SH_TAB_COMPLETION
+#include <dirent.h>
+#include <sys/stat.h>
+#endif
+
 #ifdef BB_FEATURE_SH_COMMAND_EDITING
 
 #ifndef BB_FEATURE_SH_TAB_COMPLETION
 #define BB_FEATURE_GETUSERNAME_AND_HOMEDIR
 #endif
 
-#include <stdio.h>
-#include <errno.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/ioctl.h>
-#include <ctype.h>
-#include <signal.h>
-#include <limits.h>
-
-#ifdef BB_FEATURE_SH_TAB_COMPLETION
-#include <dirent.h>
-#include <sys/stat.h>
-#endif
-
 #ifdef BB_FEATURE_GETUSERNAME_AND_HOMEDIR
 #ifndef TEST
 #include "pwd_grp/pwd.h"
@@ -1006,12 +1007,14 @@ static int find_match(char *matchBuf, int *len_with_quotes)
        /* skip first not quoted '\'' or '"' */
        for (i = 0; int_buf[i] == '\'' || int_buf[i] == '"'; i++);
        /* collapse quote or unquote // or /~ */
-       while ((int_buf[i] & ~QUOT) == '/' && (
-                                                                                  (int_buf[i + 1] & ~QUOT) == '/'
-                                                                                  || (int_buf[i + 1] & ~QUOT) ==
-                                                                                  '~')) i++;
-       if (i)
+       while ((int_buf[i] & ~QUOT) == '/' && 
+                       ((int_buf[i + 1] & ~QUOT) == '/'
+                        || (int_buf[i + 1] & ~QUOT) == '~')) {
+               i++;
+       }
+       if (i) {
                collapse_pos(0, i);
+       }
 
        /* set only match and destroy quotes */
        j = 0;