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
'typeset -xu' and 'typeset -xl' would export the variable but fail to change case in the value as the check between old and new attributes did not provide the necesssary insight for lower or upper case transcoding due to the lower or upper case attribute being set within typeset.c prior to calling name.c nv_newattr function. Previous rhbz#1188377 patch added a conditional check for size==-1 which in effect caused the nv_newattr export code block return optimization to never be executed as one cannot set any attributes using the readonly builtin. By altering the size==-1 check to !trans the export only optimization can run. Also, the rhbz#1188377 patch altered new_attr function by setting the new size to oldsize if run by the readonly builtin. The result of setting size==oldsize allowed the succeeding if statement to run more frequently and if size was a non-zero value resulted in nv_setsize resetting the value to what it already was. Investigation yielded that size was always 0 coming from the readonly builtin. src/cmd/ksh93/bltins/typeset.c: - Remove the setting of tdata.argnum to -1 as it is not needed due to existing name.c nv_newattr() logic. src/cmd/ksh93/sh/name.c: nv_newattr(): - Corrected the export only check optimization by using !trans instead of using size==-1. - Removed previous condition check to set size=oldsize if coming from the readonly builtin. nv_newattr already had existing logic to prevent changing the size via nv_setsize as size is always 0 when coming from readonly builtin.
- Loading branch information