Keep LLVM+Clang from nagging about “"foo" + 1 ≠ "foo1"” warning.

This commit is contained in:
tg 2012-12-04 01:10:35 +00:00
parent 7fc9e1b492
commit 5a70000aaf
1 changed files with 5 additions and 3 deletions

8
tree.c
View File

@ -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);