On 8/14/24 2:25 AM, Martin Kealey wrote:
Hi ChetI have worked up a patch that considerably simplifies the logic for setting and displaying the shopt compatXX settings, by getting rid of the numberous boolean variables and simply computing the setting level directly.
Thanks. The boolean variables and corresponding shopt options are frozen and only remain for backwards compatibility; there are no compatXX shopt options beyond compat44; the BASH_COMPAT variable is the current way to set the compatibility level.
However before I submit my compatXX patch, I would like to ensure I've correctly accounted for the intention of the commit below, which I assume is fairly described by this comment:If we're unsetting one of the compatibility options, make sure the current value is in the range of the compatNN space.In partiular, I'm puzzled by the introduction of this boolean expression(oldval > 44 && shell_compatibility_level < DEFAULT_COMPAT_LEVEL)
There are no compat options beyond compat44, so any value greater than that must have been set via BASH_COMPAT.
For example, once it's possible to use 'shopt -s compat52', we would then find that 'shopt -u compat52' would have no effect, unless the number "44" is updated to match any new available levels.
We're not going to do that. -- ``The lyf so short, the craft so long to lerne.'' - Chaucer ``Ars longa, vita brevis'' - Hippocrates Chet Ramey, UTech, CWRU c...@case.edu http://tiswww.cwru.edu/~chet/
OpenPGP_signature.asc
Description: OpenPGP digital signature