1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-03-09 15:50:02 +00:00

iffe: some more tweaks

src/cmd/INIT/iffe.sh:
- Remove obsolete $posix_noglob/$posix_glob code to disable and
  re-enable pathname expansion. Instead, globally disable it using
  'set -o noglob'. Except a couple of 'rm' commands, no aspect of
  this code uses globbing (note: 'case' patterns do not count), nor
  do any of the shell code feature tests that are eval'ed by iffe.
  Field splitting is heavily used via unquoted variable expansions;
  globbing should not interfere. (Concrete example: one of the test
  notes in src/cmd/ksh93/features/options is "SHOPT_* option probe"
  and that SHOPT_* is taken as a file name pattern, so could be
  expanded.) For the rm commands, globbing is turned back on in a
  subshell. If this breaks something that I've missed, hopefully
  that will turn up soon.
- Remove $show/$SHOW code to massage different versions of 'echo'
  into acting consistently; instead, use a show_test() function
  that uses the POSIX-specified printf command.
- For debugging level 2 and 3, use much more extensive PS4 prompts
  taken from modernish (which I wrote), depending on the shell.
- Replace the obsolete 'set -' command. In the ancient Bourne
  shell, this disables the v and x options, so is equivalent to
  'set +v +x'. This still works on almost all modern shells, but
  not yash, and POSIX considers it "unspecified".
- Remove a few echo|sed fallbacks I'd missed (re: 215efa15).

src/cmd/ksh93/features/math.sh:
- Disable pathname expansion here as well.
- Pass down an inherited $IFFEFLAGS to recursive iffe invocations.
This commit is contained in:
Martijn Dekker 2022-01-09 21:43:14 +00:00
parent 1a9af9db40
commit de5bdd12a4
2 changed files with 56 additions and 68 deletions

View file

@ -21,15 +21,16 @@
: generate the ksh math builtin table
: include math.tab
# @(#)math.sh (AT&T Research) 2013-08-11
# @(#)math.sh (ksh 93u+m) 2022-01-09
case $ZSH_VERSION in
?*) emulate ksh ;;
*) (command set -o posix) 2>/dev/null && set -o posix ;;
esac
set -o noglob
command=$0
iffeflags="-n -v"
iffeflags="$IFFEFLAGS -n -v"
iffehdrs="ast_float.h"
iffelibs="-lm"
table=/dev/null