• syn.c: replace expanded use of str_save() with the actual macro

• others: fix 6 (!) cases of non-constant or side-effect arguments
  to the str_save() or str_nsave() macros, and other abuse of them
• also fix some cosmetics and other un-nice code while here
This commit is contained in:
tg
2008-07-12 16:56:40 +00:00
parent 9eae0851ef
commit 0b4f34e0a8
7 changed files with 40 additions and 37 deletions

7
expr.c
View File

@ -2,7 +2,7 @@
#include "sh.h"
__RCSID("$MirOS: src/bin/mksh/expr.c,v 1.17 2008/04/20 00:24:25 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/expr.c,v 1.18 2008/07/12 16:56:38 tg Exp $");
/* The order of these enums is constrained by the order of opinfo[] */
enum token {
@ -480,9 +480,12 @@ exprtoken(Expr_state *es)
tvar = str_nsave(es->tokp, cp - es->tokp, ATEMP);
goto process_tvar;
} else if (ksh_isdigit(c)) {
int i;
while (c != '_' && (ksh_isalnux(c) || c == '#'))
c = *cp++;
tvar = str_nsave(es->tokp, --cp - es->tokp, ATEMP);
i = --cp - es->tokp;
tvar = str_nsave(es->tokp, i, ATEMP);
process_tvar:
es->val = tempvar();
es->val->flag &= ~INTEGER;