Skip to content

Commit b12be09

Browse files
committed
typeset: print_value(): save/restore last_table
This fix comes via an OpenSUSE patch but also exists in 93v- beta. https://build.opensuse.org/package/view_file/shells/ksh/ksh93-typedef.dif (only the printvalue() diff was still applicable to 93u+m; the setall() fix was done differently and better in a2f13c1)
1 parent 4645e6a commit b12be09

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

‎src/cmd/ksh93/bltins/typeset.c‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -500,6 +500,7 @@ static void print_value(Sfio_t *iop, Namval_t *np, struct tdata *tp)
500500
{
501501
char *name;
502502
int aflag=tp->aflag;
503+
Namval_t *table;
503504
if(nv_isnull(np))
504505
{
505506
if(!np->nvflag)
@@ -543,7 +544,9 @@ static void print_value(Sfio_t *iop, Namval_t *np, struct tdata *tp)
543544
sfwrite(iop,"}\n",2);
544545
return;
545546
}
547+
table = tp->sh->last_table;
546548
sfputr(iop,nv_name(np),aflag=='+'?'\n':'=');
549+
tp->sh->last_table = table;
547550
if(aflag=='+')
548551
return;
549552
if(nv_isarray(np) && nv_arrayptr(np))

0 commit comments

Comments
 (0)