Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove problematic check for standards env vars (re: 921bbca)
This commit removes the following standards check on init: strcmp(astconf("CONFORMANCE",0,0),"standard")==0 This also checks for the POSIXLY_CORRECT variable; the libast configuration system uses it to set "CONFORMANCE" to "standard", *but*, only if that parameter wasn't already initialised from the _AST_FEATURES environment variable (see 'getconf --man'). Problem is, there is a harmful interaction between POSIXLY_CORRECT and _AST_FEATURES. If the latter exists, it overrides the former. Not only that, merely querying CONFORMANCE makes astconf create and export the _AST_FEATURES variable, propagating the current setting to child ksh processes, which will then ignore POSIXLY_CORRECT. We could get around this by simply using getenv("POSIXLY_CORRECT"). But then the results may be inconsistent with the AST config state. The whole thing may not be the best idea anyway. Honouring POSIXLY_CORRECT at startup introduces a backwards compatibility issue. Existing scripts or setups may export POSIXLY_CORRECT=y to put external GNU utilities in standards mode, while still expecting traditional ksh behaviour from newly initialised shells. So it's probably better to just get rid of the check. This is not bash, after all. If ksh is invoked as sh (the POSIX standard command name), or with '-o posix' on the command line, you get the standards mode; that ought to be good enough. src/cmd/ksh93/sh/init.c: sh_init(): - Remove astconf call as per above.
- Loading branch information