Skip to content

Commit

Permalink
typeset: print_value(): save/restore last_table
Browse files Browse the repository at this point in the history
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)
  • Loading branch information
McDutchie committed Feb 2, 2021
1 parent 4645e6a commit b12be09
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/cmd/ksh93/bltins/typeset.c
Original file line number Diff line number Diff line change
Expand Up @@ -500,6 +500,7 @@ static void print_value(Sfio_t *iop, Namval_t *np, struct tdata *tp)
{
char *name;
int aflag=tp->aflag;
Namval_t *table;
if(nv_isnull(np))
{
if(!np->nvflag)
Expand Down Expand Up @@ -543,7 +544,9 @@ static void print_value(Sfio_t *iop, Namval_t *np, struct tdata *tp)
sfwrite(iop,"}\n",2);
return;
}
table = tp->sh->last_table;
sfputr(iop,nv_name(np),aflag=='+'?'\n':'=');
tp->sh->last_table = table;
if(aflag=='+')
return;
if(nv_isarray(np) && nv_arrayptr(np))
Expand Down

0 comments on commit b12be09

Please sign in to comment.