Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
This fixes the following regressions marked TODO in attributes.sh: $ typeset -L 13 bar; readonly bar; typeset -p bar typeset -r -L 0 foo # exp.: typeset -r -L 13 foo $ typeset -R 13 bar; readonly bar; typeset -p bar typeset -r -R 0 bar # exp.: typeset -r -R 13 bar $ typeset -Z 13 baz; readonly baz; typeset -p baz typeset -r -Z 0 -R 0 baz # exp.: typeset -r Z 13 -R 13 baz I've discovered that these were briefly fixed between fdb9781 (Red Hat patch for typeset -xu/-xl) and 95fe07d (reversal of patch, different -xu/-xl fix, but reintroduced these regressions). src/cmd/ksh93/sh/name.c: nv_newattr(): - Replace check from 95fe07d with a new one that combines its approach with that of fdb9781: do not change size (and hence return early) if NV_RDONLY and/or NV_EXPORT are the only attributes that are changing. src/cmd/ksh93/tests/attributes.sh: - Enable the TODO regression tests.
- Loading branch information
0e4c4d6
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@McDutchie, I will look into this further. I just recently saw those TODOs in attributes.sh. I just did not understand why having a size change from 17/13 to 0 on an undefined readonly variable meant anything as I would hope the result of the variable output would be empty string.
0e4c4d6
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See a61430f for the completion of the readonly attribute size fix.