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

typeset -p: fix output of nonexistent [0]= array element (#451)

This fix was backported from ksh 93v- 2012-10-04.

src/cmd/ksh93/sh/nvtree.c: nv_outnode():
- If the array is supposed to be empty, do not continue. This
  avoids outputting a nonexistent [0]= element for empty arrays.

Resolves: https://github.com/ksh93/ksh/issues/420
Co-authored-by: Martijn Dekker <martijn@inlv.org>
This commit is contained in:
Johnothan King 2022-02-05 05:09:25 -08:00 committed by Martijn Dekker
parent fb696ecfae
commit a8dd1bbd9d
4 changed files with 38 additions and 2 deletions

5
NEWS
View file

@ -3,6 +3,11 @@ For full details, see the git log at: https://github.com/ksh93/ksh/tree/1.0
Any uppercase BUG_* names are modernish shell bug IDs.
2022-02-04:
- Fixed a bug in 'typeset -p': for an indexed array variable that is set
but empty, it will no longer output a nonexistent '[0]=' element.
2022-02-02:
- Fixed the -a/allexport option to export all variables that are assigned