1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-03-09 15:50:02 +00:00

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 a2f13c19)
This commit is contained in:
Martijn Dekker 2021-02-02 14:31:35 +00:00
parent 4645e6ad33
commit b12be093d7

View file

@ -500,6 +500,7 @@ static void print_value(Sfio_t *iop, Namval_t *np, struct tdata *tp)
{ {
char *name; char *name;
int aflag=tp->aflag; int aflag=tp->aflag;
Namval_t *table;
if(nv_isnull(np)) if(nv_isnull(np))
{ {
if(!np->nvflag) if(!np->nvflag)
@ -543,7 +544,9 @@ static void print_value(Sfio_t *iop, Namval_t *np, struct tdata *tp)
sfwrite(iop,"}\n",2); sfwrite(iop,"}\n",2);
return; return;
} }
table = tp->sh->last_table;
sfputr(iop,nv_name(np),aflag=='+'?'\n':'='); sfputr(iop,nv_name(np),aflag=='+'?'\n':'=');
tp->sh->last_table = table;
if(aflag=='+') if(aflag=='+')
return; return;
if(nv_isarray(np) && nv_arrayptr(np)) if(nv_isarray(np) && nv_arrayptr(np))