ash: trivial code readability fixes

This commit is contained in:
Denis Vlasenko
2008-06-23 13:24:19 +00:00
parent 2b75a94118
commit 2f5d0cd511

View File

@ -357,7 +357,7 @@ onsig(int signo)
gotsig[signo - 1] = 1; gotsig[signo - 1] = 1;
pendingsig = signo; pendingsig = signo;
if ( /* exsig || */ (signo == SIGINT && !trap[SIGINT])) { if (/* exsig || */ (signo == SIGINT && !trap[SIGINT])) {
if (!suppressint) { if (!suppressint) {
pendingsig = 0; pendingsig = 0;
raise_interrupt(); /* does not return */ raise_interrupt(); /* does not return */
@ -1595,7 +1595,7 @@ nextopt(const char *optstring)
return '\0'; return '\0';
} }
c = *p++; c = *p++;
for (q = optstring; *q != c; ) { for (q = optstring; *q != c;) {
if (*q == '\0') if (*q == '\0')
ash_msg_and_raise_error("illegal option -%c", c); ash_msg_and_raise_error("illegal option -%c", c);
if (*++q == ':') if (*++q == ':')
@ -6408,7 +6408,7 @@ ifsbreakup(char *string, struct arglist *arglist)
q = p; q = p;
if (*p == CTLESC) if (*p == CTLESC)
p++; p++;
if (strchr(ifs, *p) == NULL ) { if (strchr(ifs, *p) == NULL) {
p = q; p = q;
break; break;
} }
@ -6600,7 +6600,7 @@ msort(struct strlist *list, int len)
return list; return list;
half = len >> 1; half = len >> 1;
p = list; p = list;
for (n = half; --n >= 0; ) { for (n = half; --n >= 0;) {
q = p; q = p;
p = p->next; p = p->next;
} }
@ -6960,7 +6960,7 @@ shellexec(char **argv, const char *path, int idx)
} }
exitstatus = exerrno; exitstatus = exerrno;
TRACE(("shellexec failed for %s, errno %d, suppressint %d\n", TRACE(("shellexec failed for %s, errno %d, suppressint %d\n",
argv[0], e, suppressint )); argv[0], e, suppressint));
ash_msg_and_raise(EXEXEC, "%s: %s", argv[0], errmsg(e, "not found")); ash_msg_and_raise(EXEXEC, "%s: %s", argv[0], errmsg(e, "not found"));
/* NOTREACHED */ /* NOTREACHED */
} }
@ -7731,6 +7731,7 @@ static int evalskip; /* set if we are skipping commands */
#define SKIPEVAL (1 << 4) #define SKIPEVAL (1 << 4)
static int skipcount; /* number of levels to skip */ static int skipcount; /* number of levels to skip */
static int funcnest; /* depth of function calls */ static int funcnest; /* depth of function calls */
static int loopnest; /* current loop nesting level */
/* forward decl way out to parsing code - dotrap needs it */ /* forward decl way out to parsing code - dotrap needs it */
static int evalstring(char *s, int mask); static int evalstring(char *s, int mask);
@ -7902,8 +7903,6 @@ static
#endif #endif
void evaltreenr(union node *, int) __attribute__ ((alias("evaltree"),__noreturn__)); void evaltreenr(union node *, int) __attribute__ ((alias("evaltree"),__noreturn__));
static int loopnest; /* current loop nesting level */
static void static void
evalloop(union node *n, int flags) evalloop(union node *n, int flags)
{ {
@ -9677,7 +9676,7 @@ getopts(char *optstr, char *optvar, char **optfirst, int *param_optind, int *opt
} }
c = *p++; c = *p++;
for (q = optstr; *q != c; ) { for (q = optstr; *q != c;) {
if (*q == '\0') { if (*q == '\0') {
if (optstr[0] == ':') { if (optstr[0] == ':') {
s[0] = c; s[0] = c;
@ -13474,7 +13473,7 @@ int ash_main(int argc ATTRIBUTE_UNUSED, char **argv)
if (sflag || minusc == NULL) { if (sflag || minusc == NULL) {
#if ENABLE_FEATURE_EDITING_SAVEHISTORY #if ENABLE_FEATURE_EDITING_SAVEHISTORY
if ( iflag ) { if (iflag) {
const char *hp = lookupvar("HISTFILE"); const char *hp = lookupvar("HISTFILE");
if (hp != NULL) if (hp != NULL)