-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix creation of extra associative array element '0' (#101)
Multidimensional associative arrays are created with an extra array member named '0', which is set to no value. Reproducer: $ typeset -A foo $ typeset -A foo[bar] $ typeset -p foo typeset -A foo=([bar]=([0]='') ) The bugfix prevents nv_setarray from creating the extra '[0]' member when an associative array is empty. This bug was discussed on the old mailing list: https://www.mail-archive.com/ast-developers@lists.research.att.com/msg01574.html src/cmd/ksh93/sh/array.c: - Do not allow the creation of an extra array member when an array is empty. src/cmd/ksh93/tests/arrays.sh: - Add a regression test for creating multidimensional associative arrays, but use the output from 'typeset -p' instead of fgrep.
- Loading branch information
Showing
4 changed files
with
17 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters