diff options
author | vda <vda@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2006-10-03 19:56:34 +0000 |
---|---|---|
committer | vda <vda@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2006-10-03 19:56:34 +0000 |
commit | b9e10ce275d2cc9605b842ed7e14f0dd1d98a7d2 (patch) | |
tree | beabb5991332e0e2af56b4cb885a8fd6fc7daae2 /shell | |
parent | e7fae8be11d16323ac3d3baf954eacacbc43fab5 (diff) | |
download | busybox-w32-b9e10ce275d2cc9605b842ed7e14f0dd1d98a7d2.tar.gz busybox-w32-b9e10ce275d2cc9605b842ed7e14f0dd1d98a7d2.tar.bz2 busybox-w32-b9e10ce275d2cc9605b842ed7e14f0dd1d98a7d2.zip |
lots of silly indent fixes
git-svn-id: svn://busybox.net/trunk/busybox@16302 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'shell')
-rw-r--r-- | shell/cmdedit.c | 163 |
1 files changed, 82 insertions, 81 deletions
diff --git a/shell/cmdedit.c b/shell/cmdedit.c index fb1946e83..9a57f750e 100644 --- a/shell/cmdedit.c +++ b/shell/cmdedit.c | |||
@@ -271,7 +271,6 @@ static void input_backward(int num) | |||
271 | if (num < 4) | 271 | if (num < 4) |
272 | while (num-- > 0) | 272 | while (num-- > 0) |
273 | putchar('\b'); | 273 | putchar('\b'); |
274 | |||
275 | else | 274 | else |
276 | printf("\033[%dD", num); | 275 | printf("\033[%dD", num); |
277 | } else { | 276 | } else { |
@@ -370,7 +369,7 @@ static void parse_prompt(const char *prmt_ptr) | |||
370 | pbuf = buf2; | 369 | pbuf = buf2; |
371 | *pbuf = '~'; | 370 | *pbuf = '~'; |
372 | strcpy(pbuf+1, pwd_buf+l); | 371 | strcpy(pbuf+1, pwd_buf+l); |
373 | } | 372 | } |
374 | break; | 373 | break; |
375 | #endif | 374 | #endif |
376 | case 'W': | 375 | case 'W': |
@@ -712,7 +711,7 @@ static char *add_quote_for_spec_chars(char *found, int add) | |||
712 | s[l++] = *found++; | 711 | s[l++] = *found++; |
713 | } | 712 | } |
714 | if(add) | 713 | if(add) |
715 | s[l++] = (char)add; | 714 | s[l++] = (char)add; |
716 | s[l] = 0; | 715 | s[l] = 0; |
717 | return s; | 716 | return s; |
718 | } | 717 | } |
@@ -995,7 +994,7 @@ static void showfiles(void) | |||
995 | for (row = 0; row < nrows; row++) { | 994 | for (row = 0; row < nrows; row++) { |
996 | l = strlen(matches[row]); | 995 | l = strlen(matches[row]); |
997 | if(add_char_to_match[row]) | 996 | if(add_char_to_match[row]) |
998 | l++; | 997 | l++; |
999 | if (column_width < l) | 998 | if (column_width < l) |
1000 | column_width = l; | 999 | column_width = l; |
1001 | } | 1000 | } |
@@ -1021,8 +1020,8 @@ static void showfiles(void) | |||
1021 | printf("%s%s", matches[n], str_add_chr); | 1020 | printf("%s%s", matches[n], str_add_chr); |
1022 | l = strlen(matches[n]); | 1021 | l = strlen(matches[n]); |
1023 | while(l < acol) { | 1022 | while(l < acol) { |
1024 | putchar(' '); | 1023 | putchar(' '); |
1025 | l++; | 1024 | l++; |
1026 | } | 1025 | } |
1027 | } | 1026 | } |
1028 | str_add_chr[0] = add_char_to_match[n]; | 1027 | str_add_chr[0] = add_char_to_match[n]; |
@@ -1081,30 +1080,32 @@ static void input_tab(int *lastWasTab) | |||
1081 | int i, j, n, srt; | 1080 | int i, j, n, srt; |
1082 | /* bubble */ | 1081 | /* bubble */ |
1083 | n = num_matches; | 1082 | n = num_matches; |
1084 | for(i=0; i<(n-1); i++) | 1083 | for(i=0; i<(n-1); i++) { |
1085 | for(j=i+1; j<n; j++) | 1084 | for(j=i+1; j<n; j++) { |
1086 | if(matches[i]!=NULL && matches[j]!=NULL) { | 1085 | if(matches[i]!=NULL && matches[j]!=NULL) { |
1087 | srt = strcmp(matches[i], matches[j]); | 1086 | srt = strcmp(matches[i], matches[j]); |
1088 | if(srt == 0) { | 1087 | if(srt == 0) { |
1089 | free(matches[j]); | 1088 | free(matches[j]); |
1090 | matches[j]=0; | 1089 | matches[j]=0; |
1091 | } else if(srt > 0) { | 1090 | } else if(srt > 0) { |
1092 | tmp1 = matches[i]; | 1091 | tmp1 = matches[i]; |
1093 | matches[i] = matches[j]; | 1092 | matches[i] = matches[j]; |
1094 | matches[j] = tmp1; | 1093 | matches[j] = tmp1; |
1095 | srt = add_char_to_match[i]; | 1094 | srt = add_char_to_match[i]; |
1096 | add_char_to_match[i] = add_char_to_match[j]; | 1095 | add_char_to_match[i] = add_char_to_match[j]; |
1097 | add_char_to_match[j] = srt; | 1096 | add_char_to_match[j] = srt; |
1098 | } | 1097 | } |
1098 | } | ||
1099 | } | 1099 | } |
1100 | } | ||
1100 | j = n; | 1101 | j = n; |
1101 | n = 0; | 1102 | n = 0; |
1102 | for(i=0; i<j; i++) | 1103 | for(i=0; i<j; i++) |
1103 | if(matches[i]) { | 1104 | if(matches[i]) { |
1104 | matches[n]=matches[i]; | 1105 | matches[n]=matches[i]; |
1105 | add_char_to_match[n]=add_char_to_match[i]; | 1106 | add_char_to_match[n]=add_char_to_match[i]; |
1106 | n++; | 1107 | n++; |
1107 | } | 1108 | } |
1108 | num_matches = n; | 1109 | num_matches = n; |
1109 | } | 1110 | } |
1110 | /* Did we find exactly one match? */ | 1111 | /* Did we find exactly one match? */ |
@@ -1623,61 +1624,61 @@ prepare_to_die: | |||
1623 | /* fall through */ | 1624 | /* fall through */ |
1624 | case 'd'|vbit: | 1625 | case 'd'|vbit: |
1625 | { | 1626 | { |
1626 | int nc, sc; | 1627 | int nc, sc; |
1627 | sc = cursor; | 1628 | sc = cursor; |
1628 | prevc = ic; | 1629 | prevc = ic; |
1629 | if (safe_read(0, &c, 1) < 1) | 1630 | if (safe_read(0, &c, 1) < 1) |
1630 | goto prepare_to_die; | 1631 | goto prepare_to_die; |
1631 | if (c == (prevc & 0xff)) { | 1632 | if (c == (prevc & 0xff)) { |
1632 | /* "cc", "dd" */ | 1633 | /* "cc", "dd" */ |
1633 | input_backward(cursor); | 1634 | input_backward(cursor); |
1634 | goto clear_to_eol; | 1635 | goto clear_to_eol; |
1635 | break; | 1636 | break; |
1636 | } | 1637 | } |
1637 | switch(c) { | 1638 | switch(c) { |
1638 | case 'w': | 1639 | case 'w': |
1639 | case 'W': | 1640 | case 'W': |
1640 | case 'e': | 1641 | case 'e': |
1641 | case 'E': | 1642 | case 'E': |
1642 | switch (c) { | 1643 | switch (c) { |
1643 | case 'w': /* "dw", "cw" */ | 1644 | case 'w': /* "dw", "cw" */ |
1644 | vi_word_motion(command, vi_cmdmode); | 1645 | vi_word_motion(command, vi_cmdmode); |
1645 | break; | 1646 | break; |
1646 | case 'W': /* 'dW', 'cW' */ | 1647 | case 'W': /* 'dW', 'cW' */ |
1647 | vi_Word_motion(command, vi_cmdmode); | 1648 | vi_Word_motion(command, vi_cmdmode); |
1648 | break; | 1649 | break; |
1649 | case 'e': /* 'de', 'ce' */ | 1650 | case 'e': /* 'de', 'ce' */ |
1650 | vi_end_motion(command); | 1651 | vi_end_motion(command); |
1651 | input_forward(); | 1652 | input_forward(); |
1652 | break; | 1653 | break; |
1653 | case 'E': /* 'dE', 'cE' */ | 1654 | case 'E': /* 'dE', 'cE' */ |
1654 | vi_End_motion(command); | 1655 | vi_End_motion(command); |
1655 | input_forward(); | 1656 | input_forward(); |
1656 | break; | 1657 | break; |
1657 | } | 1658 | } |
1658 | nc = cursor; | 1659 | nc = cursor; |
1659 | input_backward(cursor - sc); | 1660 | input_backward(cursor - sc); |
1660 | while (nc-- > cursor) | 1661 | while (nc-- > cursor) |
1661 | input_delete(1); | 1662 | input_delete(1); |
1662 | break; | 1663 | break; |
1663 | case 'b': /* "db", "cb" */ | 1664 | case 'b': /* "db", "cb" */ |
1664 | case 'B': /* implemented as B */ | 1665 | case 'B': /* implemented as B */ |
1665 | if (c == 'b') | 1666 | if (c == 'b') |
1666 | vi_back_motion(command); | 1667 | vi_back_motion(command); |
1667 | else | 1668 | else |
1668 | vi_Back_motion(command); | 1669 | vi_Back_motion(command); |
1669 | while (sc-- > cursor) | 1670 | while (sc-- > cursor) |
1670 | input_delete(1); | 1671 | input_delete(1); |
1671 | break; | 1672 | break; |
1672 | case ' ': /* "d ", "c " */ | 1673 | case ' ': /* "d ", "c " */ |
1673 | input_delete(1); | 1674 | input_delete(1); |
1674 | break; | 1675 | break; |
1675 | case '$': /* "d$", "c$" */ | 1676 | case '$': /* "d$", "c$" */ |
1676 | clear_to_eol: | 1677 | clear_to_eol: |
1677 | while (cursor < len) | 1678 | while (cursor < len) |
1678 | input_delete(1); | 1679 | input_delete(1); |
1679 | break; | 1680 | break; |
1680 | } | 1681 | } |
1681 | } | 1682 | } |
1682 | break; | 1683 | break; |
1683 | case 'p'|vbit: | 1684 | case 'p'|vbit: |