… but since I liked the bonus of having the hval stored so much, merge

it with the array index; var.c says that
│ 1244         /* The table entry is always [0] */
so that we can have a special flag and a union which stores hval for
the table index, the array index otherwise (coïncidentally *hint hint*
they have the same size)
This commit is contained in:
tg
2009-08-28 21:01:27 +00:00
parent bb7a720a00
commit 9b8d4023fa
5 changed files with 25 additions and 32 deletions

View File

@ -25,7 +25,7 @@
#include "sh.h"
__RCSID("$MirOS: src/bin/mksh/funcs.c,v 1.123 2009/08/28 20:30:56 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/funcs.c,v 1.124 2009/08/28 21:01:25 tg Exp $");
#if HAVE_KILLPG
/*
@ -1010,7 +1010,9 @@ c_typeset(const char **wp)
if ((vp->flag&ARRAY) && any_set)
shprintf("%s[%lu]",
vp->name,
(unsigned long)vp->index);
vp->flag & AINDEX ?
(unsigned long)vp->ua.index :
0);
else
shf_puts(vp->name, shl_stdout);
if (thing == '-' && (vp->flag&ISSET)) {