diff --git a/tree.c b/tree.c index 1513a14..8015a8d 100644 --- a/tree.c +++ b/tree.c @@ -23,7 +23,7 @@ #include "sh.h" -__RCSID("$MirOS: src/bin/mksh/tree.c,v 1.66 2012/11/30 20:19:16 tg Exp $"); +__RCSID("$MirOS: src/bin/mksh/tree.c,v 1.67 2012/12/04 01:10:35 tg Exp $"); #define INDENT 8 @@ -37,6 +37,8 @@ static void iofree(struct ioword **, Area *); /* "foo& ; bar" and "foo |& ; bar" are invalid */ static bool prevent_semicolon; +static const char Telif_pT[] = "elif %T"; + /* * print a command tree */ @@ -160,7 +162,7 @@ ptree(struct op *t, int indent, struct shf *shf) fptreef(shf, indent, "%;"); process_TIF: /* 5 == strlen("elif ") */ - fptreef(shf, indent + 5 - i, "elif %T" + i, t1->left); + fptreef(shf, indent + 5 - i, Telif_pT + i, t1->left); t1 = t1->right; if (t1->left != NULL) { fptreef(shf, indent, "%;"); @@ -177,7 +179,7 @@ ptree(struct op *t, int indent, struct shf *shf) break; case TWHILE: case TUNTIL: - /* 6 == strlen("while"/"until") */ + /* 6 == strlen("while "/"until ") */ fptreef(shf, indent + 6, "%s %T", (t->type == TWHILE) ? "while" : "until", t->left);