diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2008-06-23 13:24:19 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2008-06-23 13:24:19 +0000 |
commit | 2f5d0cd5117e4b395e7eab19d1a9727d6c921d49 (patch) | |
tree | 90edb799c3abd56f7836c1ec2ea16e49d32e7b7a /shell | |
parent | 2b75a94118b29df8d0aaa1240ab75a6ad48f2cd1 (diff) | |
download | busybox-w32-2f5d0cd5117e4b395e7eab19d1a9727d6c921d49.tar.gz busybox-w32-2f5d0cd5117e4b395e7eab19d1a9727d6c921d49.tar.bz2 busybox-w32-2f5d0cd5117e4b395e7eab19d1a9727d6c921d49.zip |
ash: trivial code readability fixes
Diffstat (limited to 'shell')
-rw-r--r-- | shell/ash.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/shell/ash.c b/shell/ash.c index e407dc395..d4da391a0 100644 --- a/shell/ash.c +++ b/shell/ash.c | |||
@@ -357,7 +357,7 @@ onsig(int signo) | |||
357 | gotsig[signo - 1] = 1; | 357 | gotsig[signo - 1] = 1; |
358 | pendingsig = signo; | 358 | pendingsig = signo; |
359 | 359 | ||
360 | if ( /* exsig || */ (signo == SIGINT && !trap[SIGINT])) { | 360 | if (/* exsig || */ (signo == SIGINT && !trap[SIGINT])) { |
361 | if (!suppressint) { | 361 | if (!suppressint) { |
362 | pendingsig = 0; | 362 | pendingsig = 0; |
363 | raise_interrupt(); /* does not return */ | 363 | raise_interrupt(); /* does not return */ |
@@ -1595,7 +1595,7 @@ nextopt(const char *optstring) | |||
1595 | return '\0'; | 1595 | return '\0'; |
1596 | } | 1596 | } |
1597 | c = *p++; | 1597 | c = *p++; |
1598 | for (q = optstring; *q != c; ) { | 1598 | for (q = optstring; *q != c;) { |
1599 | if (*q == '\0') | 1599 | if (*q == '\0') |
1600 | ash_msg_and_raise_error("illegal option -%c", c); | 1600 | ash_msg_and_raise_error("illegal option -%c", c); |
1601 | if (*++q == ':') | 1601 | if (*++q == ':') |
@@ -6408,7 +6408,7 @@ ifsbreakup(char *string, struct arglist *arglist) | |||
6408 | q = p; | 6408 | q = p; |
6409 | if (*p == CTLESC) | 6409 | if (*p == CTLESC) |
6410 | p++; | 6410 | p++; |
6411 | if (strchr(ifs, *p) == NULL ) { | 6411 | if (strchr(ifs, *p) == NULL) { |
6412 | p = q; | 6412 | p = q; |
6413 | break; | 6413 | break; |
6414 | } | 6414 | } |
@@ -6600,7 +6600,7 @@ msort(struct strlist *list, int len) | |||
6600 | return list; | 6600 | return list; |
6601 | half = len >> 1; | 6601 | half = len >> 1; |
6602 | p = list; | 6602 | p = list; |
6603 | for (n = half; --n >= 0; ) { | 6603 | for (n = half; --n >= 0;) { |
6604 | q = p; | 6604 | q = p; |
6605 | p = p->next; | 6605 | p = p->next; |
6606 | } | 6606 | } |
@@ -6960,7 +6960,7 @@ shellexec(char **argv, const char *path, int idx) | |||
6960 | } | 6960 | } |
6961 | exitstatus = exerrno; | 6961 | exitstatus = exerrno; |
6962 | TRACE(("shellexec failed for %s, errno %d, suppressint %d\n", | 6962 | TRACE(("shellexec failed for %s, errno %d, suppressint %d\n", |
6963 | argv[0], e, suppressint )); | 6963 | argv[0], e, suppressint)); |
6964 | ash_msg_and_raise(EXEXEC, "%s: %s", argv[0], errmsg(e, "not found")); | 6964 | ash_msg_and_raise(EXEXEC, "%s: %s", argv[0], errmsg(e, "not found")); |
6965 | /* NOTREACHED */ | 6965 | /* NOTREACHED */ |
6966 | } | 6966 | } |
@@ -7731,6 +7731,7 @@ static int evalskip; /* set if we are skipping commands */ | |||
7731 | #define SKIPEVAL (1 << 4) | 7731 | #define SKIPEVAL (1 << 4) |
7732 | static int skipcount; /* number of levels to skip */ | 7732 | static int skipcount; /* number of levels to skip */ |
7733 | static int funcnest; /* depth of function calls */ | 7733 | static int funcnest; /* depth of function calls */ |
7734 | static int loopnest; /* current loop nesting level */ | ||
7734 | 7735 | ||
7735 | /* forward decl way out to parsing code - dotrap needs it */ | 7736 | /* forward decl way out to parsing code - dotrap needs it */ |
7736 | static int evalstring(char *s, int mask); | 7737 | static int evalstring(char *s, int mask); |
@@ -7902,8 +7903,6 @@ static | |||
7902 | #endif | 7903 | #endif |
7903 | void evaltreenr(union node *, int) __attribute__ ((alias("evaltree"),__noreturn__)); | 7904 | void evaltreenr(union node *, int) __attribute__ ((alias("evaltree"),__noreturn__)); |
7904 | 7905 | ||
7905 | static int loopnest; /* current loop nesting level */ | ||
7906 | |||
7907 | static void | 7906 | static void |
7908 | evalloop(union node *n, int flags) | 7907 | evalloop(union node *n, int flags) |
7909 | { | 7908 | { |
@@ -9677,7 +9676,7 @@ getopts(char *optstr, char *optvar, char **optfirst, int *param_optind, int *opt | |||
9677 | } | 9676 | } |
9678 | 9677 | ||
9679 | c = *p++; | 9678 | c = *p++; |
9680 | for (q = optstr; *q != c; ) { | 9679 | for (q = optstr; *q != c;) { |
9681 | if (*q == '\0') { | 9680 | if (*q == '\0') { |
9682 | if (optstr[0] == ':') { | 9681 | if (optstr[0] == ':') { |
9683 | s[0] = c; | 9682 | s[0] = c; |
@@ -13474,7 +13473,7 @@ int ash_main(int argc ATTRIBUTE_UNUSED, char **argv) | |||
13474 | 13473 | ||
13475 | if (sflag || minusc == NULL) { | 13474 | if (sflag || minusc == NULL) { |
13476 | #if ENABLE_FEATURE_EDITING_SAVEHISTORY | 13475 | #if ENABLE_FEATURE_EDITING_SAVEHISTORY |
13477 | if ( iflag ) { | 13476 | if (iflag) { |
13478 | const char *hp = lookupvar("HISTFILE"); | 13477 | const char *hp = lookupvar("HISTFILE"); |
13479 | 13478 | ||
13480 | if (hp != NULL) | 13479 | if (hp != NULL) |