1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-03-09 15:50:02 +00:00
cde/src/cmd/ksh93/bltins
Martijn Dekker 1fbbeaa19d Convert default typeset aliases to regular builtins
This converts the 'autoload', 'compound', 'float', 'functions',
'integer' and 'nameref' default aliases into regular built-in
commands, so that 'unalias -a' does not remove them. Shell
functions can now use these names, which improves compatibility
with POSIX shell scripts.

src/cmd/ksh93/data/aliases.c:
- Remove default typeset aliases.

src/cmd/ksh93/data/builtins.c,
src/cmd/ksh93/include/builtins.h:
- Add corresponding built-in command declarations. Typeset-style
  commands are now defined by a pointer range, SYSTYPESET ..
  SYSTYPESET_END. A couple need their own IDs (SYSCOMPOUND,
  SYSNAMEREF) for special-casing in sh/xec.c.
- Update 'typeset --man'.

src/cmd/ksh93/bltins/typeset.c: b_typeset():
- Recognise the new builtin commands by argv[0]. Implement them by
  inserting the corresponding 'typeset' options into the argument
  list before parsing options. This may seem like a bit of a hack,
  but it is simpler, shorter, more future-proof and less
  error-prone than manually copying and adapting all the complex
  flaggery from the option parsing loop.

src/cmd/ksh93/sh/parse.c,
src/cmd/ksh93/sh/xec.c:
- Recognise typeset-style commands by SYSTYPESET .. SYSTYPESET_END
  pointer range.
- Special-case 'compound' (SYSCOMPOUND) and 'nameref' (SYSNAMEREF)
  along with recognising the corresponding 'typeset' options.

src/cmd/ksh93/sh.1:
- Update to document the new built-ins.
- Since not all declaration commands are special built-ins now,
  identify declaration commands using a double-dagger "\(dd"
  character (which renders as '=' in ASCII) and disassociate their
  definition from that of special built-ins.

src/cmd/ksh93/tests/variables.sh:
- Adapt a regression test as there is no more 'integer' alias.
2020-07-15 20:54:06 +01:00
..
alarm.c Version: 2012-08-01-master 2016-01-11 15:54:23 -05:00
cd_pwd.c Fix incorrect behavior of 'cd ../.foo' (#46) 2020-06-26 23:36:29 +01:00
cflow.c Fix regression in 'return' introduced by 98e0fc94 2020-06-12 01:45:17 +02:00
enum.c Fix some errors in the documentation and other minor issues (#42) 2020-06-25 19:31:51 +02:00
getopts.c Version: 2012-08-01-master 2016-01-11 15:54:23 -05:00
hist.c Remove code related to long-dead 3DFS research project 2020-06-12 01:45:17 +02:00
misc.c Millisecond precision for 'times' builtin (re: 65d363fd, 5c677a4c) 2020-07-15 04:22:45 +01:00
mkservice.c Version: 2012-08-01-master 2016-01-11 15:54:23 -05:00
print.c rm "I/O error" error msg; just keep >0 exit status (re: 9011fa93) 2020-06-12 01:45:18 +02:00
read.c Fix a crash when 'read -u' is given an invalid fd (#53) 2020-07-01 18:14:10 +01:00
regress.c Fix 47 typos in user-facing help and error messages 2020-06-12 01:45:12 +02:00
sleep.c Version: 2012-08-01-master 2016-01-11 15:54:23 -05:00
test.c silence macro redefinition warnings (re: 7003aba4) 2020-06-16 04:51:21 +02:00
trap.c Make 'stop' and 'suspend' regular built-ins 2020-06-22 15:36:29 +02:00
typeset.c Convert default typeset aliases to regular builtins 2020-07-15 20:54:06 +01:00
ulimit.c Version: 2012-08-01-master 2016-01-11 15:54:23 -05:00
umask.c Version: 2012-08-01-master 2016-01-11 15:54:23 -05:00
whence.c Fix 'whence -a' to print correct path for tracked alias (#25) 2020-06-19 14:03:58 +02:00