remove some more of this ugliness

This commit is contained in:
tg 2010-01-29 09:34:31 +00:00
parent c67bed8790
commit 4eb17f8752
9 changed files with 109 additions and 84 deletions

View File

@ -1,4 +1,4 @@
# $MirOS: src/bin/mksh/check.t,v 1.358 2010/01/28 20:58:30 tg Exp $ # $MirOS: src/bin/mksh/check.t,v 1.359 2010/01/29 09:34:25 tg Exp $
# $OpenBSD: bksl-nl.t,v 1.2 2001/01/28 23:04:56 niklas Exp $ # $OpenBSD: bksl-nl.t,v 1.2 2001/01/28 23:04:56 niklas Exp $
# $OpenBSD: history.t,v 1.5 2001/01/28 23:04:56 niklas Exp $ # $OpenBSD: history.t,v 1.5 2001/01/28 23:04:56 niklas Exp $
# $OpenBSD: read.t,v 1.3 2003/03/10 03:48:16 david Exp $ # $OpenBSD: read.t,v 1.3 2003/03/10 03:48:16 david Exp $
@ -25,7 +25,7 @@
# http://www.research.att.com/~gsf/public/ifs.sh # http://www.research.att.com/~gsf/public/ifs.sh
expected-stdout: expected-stdout:
@(#)MIRBSD KSH R39 2010/01/28 @(#)MIRBSD KSH R39 2010/01/29
description: description:
Check version of shell. Check version of shell.
stdin: stdin:

6
edit.c
View File

@ -25,7 +25,7 @@
#include "sh.h" #include "sh.h"
__RCSID("$MirOS: src/bin/mksh/edit.c,v 1.188 2010/01/08 22:21:04 tg Exp $"); __RCSID("$MirOS: src/bin/mksh/edit.c,v 1.189 2010/01/29 09:34:26 tg Exp $");
/* tty driver characters we are interested in */ /* tty driver characters we are interested in */
typedef struct { typedef struct {
@ -4034,7 +4034,7 @@ vi_cmd(int argcnt, const char *cmd)
case 'g': case 'g':
if (!argcnt) if (!argcnt)
argcnt = hlast; argcnt = hlast;
/* FALLTHRU */ /* FALLTHROUGH */
case 'G': case 'G':
if (!argcnt) if (!argcnt)
argcnt = 1; argcnt = 1;
@ -4188,7 +4188,7 @@ vi_cmd(int argcnt, const char *cmd)
c3 = 1; c3 = 1;
srchlen = 0; srchlen = 0;
lastsearch = *cmd; lastsearch = *cmd;
/* FALLTHRU */ /* FALLTHROUGH */
case 'n': case 'n':
case 'N': case 'N':
if (lastsearch == ' ') if (lastsearch == ' ')

4
eval.c
View File

@ -22,7 +22,7 @@
#include "sh.h" #include "sh.h"
__RCSID("$MirOS: src/bin/mksh/eval.c,v 1.81 2010/01/25 14:07:38 tg Exp $"); __RCSID("$MirOS: src/bin/mksh/eval.c,v 1.82 2010/01/29 09:34:27 tg Exp $");
/* /*
* string expansion * string expansion
@ -551,7 +551,7 @@ expand(const char *cp, /* input word */
case '?': case '?':
f &= ~DOBLANK; f &= ~DOBLANK;
f |= DOTEMP_; f |= DOTEMP_;
/* FALLTHRU */ /* FALLTHROUGH */
default: default:
/* Enable tilde expansion */ /* Enable tilde expansion */
tilde_ok = 1; tilde_ok = 1;

View File

@ -26,7 +26,7 @@
#include <sys/file.h> #include <sys/file.h>
#endif #endif
__RCSID("$MirOS: src/bin/mksh/histrap.c,v 1.91 2010/01/25 16:12:55 tg Exp $"); __RCSID("$MirOS: src/bin/mksh/histrap.c,v 1.92 2010/01/29 09:34:28 tg Exp $");
/*- /*-
* MirOS: This is the default mapping type, and need not be specified. * MirOS: This is the default mapping type, and need not be specified.
@ -790,8 +790,10 @@ hist_count_lines(unsigned char *base, int bytes)
case sn4: case sn4:
state = sline; break; state = sline; break;
case sline: case sline:
if (*base == '\0') if (*base == '\0') {
lines++, state = shdr; lines++;
state = shdr;
}
} }
base++; base++;
} }

137
lex.c
View File

@ -22,7 +22,7 @@
#include "sh.h" #include "sh.h"
__RCSID("$MirOS: src/bin/mksh/lex.c,v 1.106 2010/01/28 20:58:32 tg Exp $"); __RCSID("$MirOS: src/bin/mksh/lex.c,v 1.107 2010/01/29 09:34:28 tg Exp $");
/* /*
* states while lexing word * states while lexing word
@ -206,7 +206,8 @@ yylex(int cf)
if (cf&ONEWORD) if (cf&ONEWORD)
state = SWORD; state = SWORD;
else if (cf&LETEXPR) { else if (cf&LETEXPR) {
*wp++ = OQUOTE; /* enclose arguments in (double) quotes */ /* enclose arguments in (double) quotes */
*wp++ = OQUOTE;
state = SLETPAREN; state = SLETPAREN;
statep->ls_sletparen.nparen = 0; statep->ls_sletparen.nparen = 0;
#ifndef MKSH_SMALL #ifndef MKSH_SMALL
@ -273,7 +274,7 @@ yylex(int cf)
/* FALLTHROUGH */ /* FALLTHROUGH */
case SBASE: case SBASE:
if (c == '[' && (cf & (VARASN|ARRAYVAR))) { if (c == '[' && (cf & (VARASN|ARRAYVAR))) {
*wp = EOS; /* temporary */ *wp = EOS; /* temporary */
if (is_wdvarname(Xstring(ws, wp), false)) { if (is_wdvarname(Xstring(ws, wp), false)) {
char *p, *tmp; char *p, *tmp;
@ -302,7 +303,7 @@ yylex(int cf)
*wp++ = c; *wp++ = c;
break; break;
} }
/* FALLTHRU */ /* FALLTHROUGH */
Sbase1: /* includes *(...|...) pattern (*+?@!) */ Sbase1: /* includes *(...|...) pattern (*+?@!) */
if (c == '*' || c == '@' || c == '+' || c == '?' || if (c == '*' || c == '@' || c == '+' || c == '?' ||
c == '!') { c == '!') {
@ -315,13 +316,16 @@ yylex(int cf)
} }
ungetsc(c2); ungetsc(c2);
} }
/* FALLTHRU */ /* FALLTHROUGH */
Sbase2: /* doesn't include *(...|...) pattern (*+?@!) */ Sbase2: /* doesn't include *(...|...) pattern (*+?@!) */
switch (c) { switch (c) {
case '\\': case '\\':
c = getsc(); c = getsc();
if (c) /* trailing \ is lost */ if (c) {
*wp++ = QCHAR, *wp++ = c; /* trailing \ is lost */
*wp++ = QCHAR;
*wp++ = c;
}
break; break;
case '\'': case '\'':
*wp++ = OQUOTE; *wp++ = OQUOTE;
@ -348,14 +352,18 @@ yylex(int cf)
/* FALLTHROUGH */ /* FALLTHROUGH */
case '\\': case '\\':
case '$': case '`': case '$': case '`':
*wp++ = QCHAR, *wp++ = c; *wp++ = QCHAR;
*wp++ = c;
break; break;
default: default:
heredocquote: heredocquote:
Xcheck(ws, wp); Xcheck(ws, wp);
if (c) { /* trailing \ is lost */ if (c) {
*wp++ = CHAR, *wp++ = '\\'; /* trailing \ is lost */
*wp++ = CHAR, *wp++ = c; *wp++ = CHAR;
*wp++ = '\\';
*wp++ = CHAR;
*wp++ = c;
} }
break; break;
} }
@ -384,7 +392,8 @@ yylex(int cf)
c = getsc(); c = getsc();
/* allow :# and :% (ksh88 compat) */ /* allow :# and :% (ksh88 compat) */
if (c == ':') { if (c == ':') {
*wp++ = CHAR, *wp++ = c; *wp++ = CHAR;
*wp++ = c;
c = getsc(); c = getsc();
if (c == ':') { if (c == ':') {
*wp++ = CHAR; *wp++ = CHAR;
@ -416,7 +425,8 @@ yylex(int cf)
break; break;
} }
} else if (c == '/') { } else if (c == '/') {
*wp++ = CHAR, *wp++ = c; *wp++ = CHAR;
*wp++ = c;
if ((c = getsc()) == '/') { if ((c = getsc()) == '/') {
*wp++ = ADELIM; *wp++ = ADELIM;
*wp++ = c; *wp++ = c;
@ -468,7 +478,8 @@ yylex(int cf)
statep->ls_sequote.got_NUL = false; statep->ls_sequote.got_NUL = false;
break; break;
} else { } else {
*wp++ = CHAR, *wp++ = '$'; *wp++ = CHAR;
*wp++ = '$';
ungetsc(c); ungetsc(c);
} }
break; break;
@ -518,9 +529,10 @@ yylex(int cf)
*wp++ = getsc(); *wp++ = getsc();
break; break;
} }
/* FALLTHRU */ /* FALLTHROUGH */
default: default:
*wp++ = CHAR, *wp++ = c; *wp++ = CHAR;
*wp++ = c;
} }
break; break;
@ -537,9 +549,10 @@ yylex(int cf)
if (!statep->ls_sequote.got_NUL) { if (!statep->ls_sequote.got_NUL) {
char ts[4]; char ts[4];
if ((unsigned int)c2 < 0x100) if ((unsigned int)c2 < 0x100) {
*wp++ = QCHAR, *wp++ = c2; *wp++ = QCHAR;
else { *wp++ = c2;
} else {
c = utf_wctomb(ts, c2 - 0x100); c = utf_wctomb(ts, c2 - 0x100);
ts[c] = 0; ts[c] = 0;
for (c = 0; ts[c]; ++c) { for (c = 0; ts[c]; ++c) {
@ -548,8 +561,10 @@ yylex(int cf)
} }
} }
} }
} else if (!statep->ls_sequote.got_NUL) } else if (!statep->ls_sequote.got_NUL) {
*wp++ = QCHAR, *wp++ = c; *wp++ = QCHAR;
*wp++ = c;
}
break; break;
case SSQUOTE: case SSQUOTE:
@ -557,8 +572,10 @@ yylex(int cf)
POP_STATE(); POP_STATE();
*wp++ = CQUOTE; *wp++ = CQUOTE;
ignore_backslash_newline--; ignore_backslash_newline--;
} else } else {
*wp++ = QCHAR, *wp++ = c; *wp++ = QCHAR;
*wp++ = c;
}
break; break;
case SDQUOTE: case SDQUOTE:
@ -569,14 +586,14 @@ yylex(int cf)
goto Subst; goto Subst;
break; break;
case SCSPAREN: /* $( ... ) */ case SCSPAREN: /* $( ... ) */
/* todo: deal with $(...) quoting properly /* todo: deal with $(...) quoting properly
* kludge to partly fake quoting inside $(...): doesn't * kludge to partly fake quoting inside $(...): doesn't
* really work because nested $(...) or ${...} inside * really work because nested $(...) or ${...} inside
* double quotes aren't dealt with. * double quotes aren't dealt with.
*/ */
switch (statep->ls_scsparen.csstate) { switch (statep->ls_scsparen.csstate) {
case 0: /* normal */ case 0: /* normal */
switch (c) { switch (c) {
case '(': case '(':
statep->ls_scsparen.nparen++; statep->ls_scsparen.nparen++;
@ -597,19 +614,19 @@ yylex(int cf)
} }
break; break;
case 1: /* backslash in normal mode */ case 1: /* backslash in normal mode */
case 3: /* backslash in double quotes */ case 3: /* backslash in double quotes */
--statep->ls_scsparen.csstate; --statep->ls_scsparen.csstate;
break; break;
case 2: /* double quotes */ case 2: /* double quotes */
if (c == '"') if (c == '"')
statep->ls_scsparen.csstate = 0; statep->ls_scsparen.csstate = 0;
else if (c == '\\') else if (c == '\\')
statep->ls_scsparen.csstate = 3; statep->ls_scsparen.csstate = 3;
break; break;
case 4: /* single quotes */ case 4: /* single quotes */
if (c == '\'') { if (c == '\'') {
statep->ls_scsparen.csstate = 0; statep->ls_scsparen.csstate = 0;
ignore_backslash_newline--; ignore_backslash_newline--;
@ -618,12 +635,12 @@ yylex(int cf)
} }
if (statep->ls_scsparen.nparen == 0) { if (statep->ls_scsparen.nparen == 0) {
POP_STATE(); POP_STATE();
*wp++ = 0; /* end of COMSUB */ *wp++ = 0; /* end of COMSUB */
} else } else
*wp++ = c; *wp++ = c;
break; break;
case SASPAREN: /* $(( ... )) */ case SASPAREN: /* $(( ... )) */
/* XXX should nest using existing state machine /* XXX should nest using existing state machine
* (embed "...", $(...), etc.) */ * (embed "...", $(...), etc.) */
if (c == '(') if (c == '(')
@ -634,7 +651,8 @@ yylex(int cf)
/*(*/ /*(*/
if ((c2 = getsc()) == ')') { if ((c2 = getsc()) == ')') {
POP_STATE(); POP_STATE();
*wp++ = 0; /* end of EXPRSUB */ /* end of EXPRSUB */
*wp++ = 0;
break; break;
} else { } else {
char *s; char *s;
@ -702,9 +720,10 @@ yylex(int cf)
*wp++ = c; *wp++ = c;
break; break;
} }
/* FALLTHRU */ /* FALLTHROUGH */
default: default:
if (c) { /* trailing \ is lost */ if (c) {
/* trailing \ is lost */
*wp++ = '\\'; *wp++ = '\\';
*wp++ = c; *wp++ = c;
} }
@ -760,14 +779,16 @@ yylex(int cf)
c = 0; c = 0;
goto Done; goto Done;
} }
*wp++ = CHAR, *wp++ = c; *wp++ = CHAR;
*wp++ = c;
break; break;
#endif #endif
case SHERESTRING: /* <<< delimiter */ case SHERESTRING: /* <<< delimiter */
if (c == '\\') { if (c == '\\') {
c = getsc(); c = getsc();
if (c) { /* trailing \ is lost */ if (c) {
/* trailing \ is lost */
*wp++ = QCHAR; *wp++ = QCHAR;
*wp++ = c; *wp++ = c;
} }
@ -810,7 +831,8 @@ yylex(int cf)
*/ */
if (c == '\\') { if (c == '\\') {
c = getsc(); c = getsc();
if (c) { /* trailing \ is lost */ if (c) {
/* trailing \ is lost */
*wp++ = QCHAR; *wp++ = QCHAR;
*wp++ = c; *wp++ = c;
} }
@ -851,7 +873,8 @@ yylex(int cf)
case '$': case '`': case '$': case '`':
break; break;
default: default:
if (c) { /* trailing \ lost */ if (c) {
/* trailing \ lost */
*wp++ = CHAR; *wp++ = CHAR;
*wp++ = '\\'; *wp++ = '\\';
} }
@ -1289,7 +1312,7 @@ getsc__(void)
continue; continue;
case SREREAD: case SREREAD:
if (s->start != s->ugbuf) /* yuck */ if (s->start != s->ugbuf) /* yuck */
afree(s->u.freeme, ATEMP); afree(s->u.freeme, ATEMP);
source = s = s->next; source = s = s->next;
continue; continue;
@ -1365,9 +1388,9 @@ getsc_line(Source *s)
if (!p || (xp = p, xp[-1] == '\n')) if (!p || (xp = p, xp[-1] == '\n'))
break; break;
/* double buffer size */ /* double buffer size */
xp++; /* move past null so doubling works... */ xp++; /* move past NUL so doubling works... */
XcheckN(s->xs, xp, Xlength(s->xs, xp)); XcheckN(s->xs, xp, Xlength(s->xs, xp));
xp--; /* ...and move back again */ xp--; /* ...and move back again */
} }
/* flush any unwanted input so other programs/builtins /* flush any unwanted input so other programs/builtins
* can read it. Not very optimal, but less error prone * can read it. Not very optimal, but less error prone
@ -1409,7 +1432,8 @@ getsc_line(Source *s)
s->start = s->str = cp; s->start = s->str = cp;
strip_nuls(Xstring(s->xs, xp), Xlength(s->xs, xp)); strip_nuls(Xstring(s->xs, xp), Xlength(s->xs, xp));
/* Note: if input is all nulls, this is not eof */ /* Note: if input is all nulls, this is not eof */
if (Xlength(s->xs, xp) == 0) { /* EOF */ if (Xlength(s->xs, xp) == 0) {
/* EOF */
if (s->type == SFILE) if (s->type == SFILE)
shf_fdclose(s->u.shf); shf_fdclose(s->u.shf);
s->str = NULL; s->str = NULL;
@ -1435,7 +1459,7 @@ set_prompt(int to, Source *s)
cur_prompt = to; cur_prompt = to;
switch (to) { switch (to) {
case PS1: /* command */ case PS1: /* command */
/* Substitute ! and !! here, before substitutions are done /* Substitute ! and !! here, before substitutions are done
* so ! in expanded variables are not expanded. * so ! in expanded variables are not expanded.
* NOTE: this is not what AT&T ksh does (it does it after * NOTE: this is not what AT&T ksh does (it does it after
@ -1473,7 +1497,7 @@ set_prompt(int to, Source *s)
quitenv(NULL); quitenv(NULL);
} }
break; break;
case PS2: /* command continuation */ case PS2: /* command continuation */
prompt = str_val(global("PS2")); prompt = str_val(global("PS2"));
break; break;
} }
@ -1548,7 +1572,7 @@ get_brace_var(XString *wsp, char *wp)
{ {
enum parse_state { enum parse_state {
PS_INITIAL, PS_SAW_HASH, PS_IDENT, PS_INITIAL, PS_SAW_HASH, PS_IDENT,
PS_NUMBER, PS_VAR1, PS_END PS_NUMBER, PS_VAR1
} state; } state;
char c; char c;
@ -1562,7 +1586,7 @@ get_brace_var(XString *wsp, char *wp)
state = PS_SAW_HASH; state = PS_SAW_HASH;
break; break;
} }
/* FALLTHRU */ /* FALLTHROUGH */
case PS_SAW_HASH: case PS_SAW_HASH:
if (ksh_isalphx(c)) if (ksh_isalphx(c))
state = PS_IDENT; state = PS_IDENT;
@ -1571,11 +1595,10 @@ get_brace_var(XString *wsp, char *wp)
else if (ctype(c, C_VAR1)) else if (ctype(c, C_VAR1))
state = PS_VAR1; state = PS_VAR1;
else else
state = PS_END; goto out;
break; break;
case PS_IDENT: case PS_IDENT:
if (!ksh_isalnux(c)) { if (!ksh_isalnux(c)) {
state = PS_END;
if (c == '[') { if (c == '[') {
char *tmp, *p; char *tmp, *p;
@ -1587,28 +1610,24 @@ get_brace_var(XString *wsp, char *wp)
*wp++ = *p++; *wp++ = *p++;
} }
afree(tmp, ATEMP); afree(tmp, ATEMP);
c = getsc(); /* the ] */ c = getsc(); /* the ] */
} }
goto out;
} }
break; break;
case PS_NUMBER: case PS_NUMBER:
if (!ksh_isdigit(c)) if (!ksh_isdigit(c))
state = PS_END; goto out;
break; break;
case PS_VAR1: case PS_VAR1:
state = PS_END; goto out;
break;
case PS_END: /* keep gcc happy */
break;
}
if (state == PS_END) {
*wp++ = '\0'; /* end of variable part */
ungetsc(c);
break;
} }
Xcheck(*wsp, wp); Xcheck(*wsp, wp);
*wp++ = c; *wp++ = c;
} }
out:
*wp++ = '\0'; /* end of variable part */
ungetsc(c);
return (wp); return (wp);
} }

8
main.c
View File

@ -33,7 +33,7 @@
#include <locale.h> #include <locale.h>
#endif #endif
__RCSID("$MirOS: src/bin/mksh/main.c,v 1.161 2010/01/28 15:18:48 tg Exp $"); __RCSID("$MirOS: src/bin/mksh/main.c,v 1.162 2010/01/29 09:34:29 tg Exp $");
extern char **environ; extern char **environ;
@ -505,7 +505,7 @@ include(const char *name, int argc, const char **argv, int intr_ok)
*/ */
if (intr_ok && (exstat - 128) != SIGTERM) if (intr_ok && (exstat - 128) != SIGTERM)
return (1); return (1);
/* FALLTHRU */ /* FALLTHROUGH */
case LEXIT: case LEXIT:
case LLEAVE: case LLEAVE:
case LSHELL: case LSHELL:
@ -585,7 +585,7 @@ shell(Source * volatile s, volatile int toplevel)
s->start = s->str = null; s->start = s->str = null;
break; break;
} }
/* FALLTHRU */ /* FALLTHROUGH */
case LEXIT: case LEXIT:
case LLEAVE: case LLEAVE:
case LRETURN: case LRETURN:
@ -672,7 +672,7 @@ unwind(int i)
case E_NONE: case E_NONE:
if (i == LINTR) if (i == LINTR)
e->flags |= EF_FAKE_SIGDIE; e->flags |= EF_FAKE_SIGDIE;
/* FALLTHRU */ /* FALLTHROUGH */
default: default:
quitenv(NULL); quitenv(NULL);
} }

8
misc.c
View File

@ -29,7 +29,7 @@
#include <grp.h> #include <grp.h>
#endif #endif
__RCSID("$MirOS: src/bin/mksh/misc.c,v 1.137 2010/01/28 15:18:49 tg Exp $"); __RCSID("$MirOS: src/bin/mksh/misc.c,v 1.138 2010/01/29 09:34:29 tg Exp $");
unsigned char chtypes[UCHAR_MAX + 1]; /* type bits for unsigned char */ unsigned char chtypes[UCHAR_MAX + 1]; /* type bits for unsigned char */
@ -551,8 +551,10 @@ has_globbing(const char *xp, const char *xpe)
} else if (nest) } else if (nest)
nest--; nest--;
} }
/* else must be a MAGIC-MAGIC, or MAGIC-!, MAGIC--, MAGIC-] /*
MAGIC-{, MAGIC-,, MAGIC-} */ * else must be a MAGIC-MAGIC, or MAGIC-!,
* MAGIC--, MAGIC-], MAGIC-{, MAGIC-, MAGIC-}
*/
} }
return (saw_glob && !in_bracket && !nest); return (saw_glob && !in_bracket && !nest);
} }

12
sh.h
View File

@ -150,9 +150,9 @@
#endif #endif
#ifdef EXTERN #ifdef EXTERN
__RCSID("$MirOS: src/bin/mksh/sh.h,v 1.379 2010/01/28 20:58:34 tg Exp $"); __RCSID("$MirOS: src/bin/mksh/sh.h,v 1.380 2010/01/29 09:34:30 tg Exp $");
#endif #endif
#define MKSH_VERSION "R39 2010/01/28" #define MKSH_VERSION "R39 2010/01/29"
#ifndef MKSH_INCLUDES_ONLY #ifndef MKSH_INCLUDES_ONLY
@ -797,9 +797,11 @@ EXTERN mksh_ari_t x_lins I__(-1); /* tty lines */
int shf_getc(struct shf *); int shf_getc(struct shf *);
int shf_putc(int, struct shf *); int shf_putc(int, struct shf *);
#else #else
#define shf_getc(shf) ((shf)->rnleft > 0 ? (shf)->rnleft--, *(shf)->rp++ : \ #define shf_getc(shf) ((shf)->rnleft > 0 ? \
shf_getchar(shf)) (shf)->rnleft--, *(shf)->rp++ : \
#define shf_putc(c, shf) ((shf)->wnleft == 0 ? shf_putchar((c), (shf)) : \ shf_getchar(shf))
#define shf_putc(c, shf) ((shf)->wnleft == 0 ? \
shf_putchar((c), (shf)) : \
((shf)->wnleft--, *(shf)->wp++ = (c))) ((shf)->wnleft--, *(shf)->wp++ = (c)))
#endif #endif
#define shf_eof(shf) ((shf)->flags & SHF_EOF) #define shf_eof(shf) ((shf)->flags & SHF_EOF)

6
tree.c
View File

@ -1,7 +1,7 @@
/* $OpenBSD: tree.c,v 1.19 2008/08/11 21:50:35 jaredy Exp $ */ /* $OpenBSD: tree.c,v 1.19 2008/08/11 21:50:35 jaredy Exp $ */
/*- /*-
* Copyright (c) 2003, 2004, 2005, 2006, 2007, 2008, 2009 * Copyright (c) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
* Thorsten Glaser <tg@mirbsd.org> * Thorsten Glaser <tg@mirbsd.org>
* *
* Provided that these terms and disclaimer and all copyright notices * Provided that these terms and disclaimer and all copyright notices
@ -22,7 +22,7 @@
#include "sh.h" #include "sh.h"
__RCSID("$MirOS: src/bin/mksh/tree.c,v 1.28 2009/06/10 18:12:50 tg Exp $"); __RCSID("$MirOS: src/bin/mksh/tree.c,v 1.29 2010/01/29 09:34:31 tg Exp $");
#define INDENT 4 #define INDENT 4
@ -95,7 +95,7 @@ ptree(struct op *t, int indent, struct shf *shf)
} }
case TSELECT: case TSELECT:
fptreef(shf, indent, "select %s ", t->str); fptreef(shf, indent, "select %s ", t->str);
/* FALLTHRU */ /* FALLTHROUGH */
case TFOR: case TFOR:
if (t->type == TFOR) if (t->type == TFOR)
fptreef(shf, indent, "for %s ", t->str); fptreef(shf, indent, "for %s ", t->str);