1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-02-24 15:04:13 +00:00
cde/src/cmd/ksh93/include
Martijn Dekker f45a0f1650 -o posix: inverse-sync braceexpand; properly sync letoctal
{Brace,expansion} is potentially incompatible with POSIX scripts,
because in POSIX those are simple literal strings with no special
meaning. So the POSIX option should really turn that off.

As of b301d417, the 'posix' option was also forcing 'letoctal'
behaviour on, without actually setting that option. I've since
found that to be a botch; 'let' may recognise octals without that
option being set, and that looks like a bug.

So as of this commit, the '-o posix' option actually toggles both
of these options off/on and on/of, respectively. 'set +o posix'
toggles them inversely. However, it is now possible to control both
options (and their associated behaviour) independently in between
'set -o posix' and 'set +o posix'. Much better.

src/cmd/ksh93/sh/main.c: sh_main():
- If SH_POSIX was set on init, turn on SH_LETOCTAL by default
  instead of SH_BRACEEXPAND.

src/cmd/ksh93/sh/args.c: sh_applyopts():
- Turn off SH_BRACEEXPAND and turn on SH_LETOCTAL when SH_POSIX is
  turned on (but not if it was already on).
- Turn on SH_BRACEEXPAND and turn off SH_LETOCTAL when SH_POSIX is
  turned off (but not if it was already off).

src/cmd/ksh93/sh/arith.c: arith():
- Revert to pre-b301d417 and only check SH_LETOCTAL option when
  deciding whether 'let' should skip initial zeros.

src/cmd/ksh93/tests/options.sh:
- Update $- test to allow '-o posix' to switch B = braceexpand.

src/cmd/ksh93/sh.1:
- Update.
- Edit for clarity.
2020-09-18 22:07:44 +02:00
..
argnod.h 4 typo fixes: be use => be used 2020-07-05 07:48:01 +02:00
builtins.h Remove SHOPT_BASH; keep &> redir operator, '-o posix' option 2020-09-01 06:19:19 +01:00
defs.h Work around process substitution file descriptor leak 2020-09-12 20:22:19 +02:00
edit.h include/edit.h: cleanup: rm unused Edit_t struct members 2020-09-16 06:38:53 +02:00
fault.h Remove legacy code for older libast versions 2020-09-04 02:31:39 +02:00
fcin.h Version: 2012-08-01-master 2016-01-11 15:54:23 -05:00
history.h Version: 2012-08-01-master 2016-01-11 15:54:23 -05:00
io.h Remove SHOPT_BASH; keep &> redir operator, '-o posix' option 2020-09-01 06:19:19 +01:00
jobs.h Fix compile with -D_std_malloc (re: f9c127e) (#130) 2020-09-08 03:20:18 +01:00
lexstates.h Fix 80 typos in comments 2020-06-12 01:45:12 +02:00
name.h Fix memory leak in typeset (rhbz#1036470) 2020-09-15 23:52:32 +02:00
national.h Version: 2012-08-01-master 2016-01-11 15:54:23 -05:00
nval.h nval.h: remove dtksh additions & old compat redefs (re: e2d1b593) 2020-08-17 23:11:51 +01:00
path.h remove unused 'is an exported alias' message (re: 80d9ae2b) 2020-07-19 06:21:14 +01:00
regress.h Version: 2012-08-01-master 2016-01-11 15:54:23 -05:00
shell.h Fix BUG_LOOPRET2 and related return/exit misbehaviour 2020-09-09 20:02:20 +02:00
shlex.h Remove SHOPT_BASH; keep &> redir operator, '-o posix' option 2020-09-01 06:19:19 +01:00
shnodes.h Version: 2012-08-01-master 2016-01-11 15:54:23 -05:00
shtable.h Reinstate 'r' and 'history' as preset aliases for interactive ksh 2020-09-11 21:35:45 +02:00
streval.h Remove legacy code for older libast versions 2020-09-04 02:31:39 +02:00
terminal.h Fixes for implicit declaration warnings 2020-06-14 09:55:08 -04:00
test.h restore 'test --man --' oddness (re: fa6a180f) 2020-08-31 23:43:22 +01:00
timeout.h Version: 2012-08-01-master 2016-01-11 15:54:23 -05:00
ulimit.h Version: 2012-08-01-master 2016-01-11 15:54:23 -05:00
variables.h Add ${.sh.pid} as an alternative to $BASHPID (#109) 2020-08-07 02:53:25 +01:00
version.h -o posix: inverse-sync braceexpand; properly sync letoctal 2020-09-18 22:07:44 +02:00