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 ddaa145b3d Reinstate 'r' and 'history' as preset aliases for interactive ksh
Following a community discussion, it became clear that 'r' is
particularly problematic as a regular builtin, as the name can and
does conflict with at least one legit external command by that
name. There was a consensus against removing it altogether and
letting users set the alias in their login scripts. However,
aliases are easier to bypass, remove or rename than builtins are.
My compromise is to reinstate 'r' as a preset alias on interactive
shells only, along with 'history', as was done in 17f81ebe before
they were converted to builtins in 03224ae3. So this reintroduces
the notion of predefined aliases to ksh 93u+m, but only for
interactive shells that are not initialised in POSIX mode.

src/cmd/ksh93/Makefile,
src/cmd/ksh93/Mamfile,
src/cmd/ksh93/include/shtable.h,
src/cmd/ksh93/data/aliases.c:
- Restore aliases.c containing shtab_aliases[], a table specifying
  the preset aliases.

src/cmd/ksh93/include/shtable.h,
src/cmd/ksh93/sh/init.c:
- Rename inittree() to sh_inittree() and make it extern, because we
  need to use it in main.c (sh_main()).

src/cmd/ksh93/sh/main.c: sh_main():
- Init preset aliases from shtab_aliases[] only if the shell is
  interactive and not in POSIX mode.

src/cmd/ksh93/bltins/typeset.c,
src/cmd/ksh93/tests/alias.sh:
- unall(): When unsetting an alias, pass on the NV_NOFREE attribute
  to nv_delete() to avoid an erroneous attempt to free a preset
  alias from read-only memory. See: 5d50f825

src/cmd/ksh93/data/builtins.c:
- Remove "history" and "r" entries from shtab_builtins[].
- Revert changes to inline fc/hist docs in sh_opthist[].

src/cmd/ksh93/bltins/hist.c: b_hist():
- Remove handling for 'history' and 'r' as builtins.

src/cmd/ksh93/sh.1:
- Update accordingly.

Resolves: https://github.com/ksh93/ksh/issues/125
2020-09-11 21:35:45 +02: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 BUG_LOOPRET2 and related return/exit misbehaviour 2020-09-09 20:02:20 +02:00
enum.c '#if 0' cleanup 2020-08-30 04:51:20 +01:00
getopts.c Version: 2012-08-01-master 2016-01-11 15:54:23 -05:00
hist.c Reinstate 'r' and 'history' as preset aliases for interactive ksh 2020-09-11 21:35:45 +02:00
misc.c Remove abandoned SHOPT_ENV experiment 2020-09-02 16:09:57 +01:00
mkservice.c '#if 0' cleanup 2020-08-30 04:51:20 +01:00
print.c Remove legacy code for older libast versions 2020-09-04 02:31:39 +02:00
read.c SHOPT_MULTIBYTE-related cleanup (re: 8477d2ce) 2020-08-30 04:50:57 +01:00
regress.c Fix 47 typos in user-facing help and error messages 2020-06-12 01:45:12 +02:00
sleep.c Fix how unrecognized options are handled in 'sleep' and 'suspend' (#93) 2020-07-26 02:18:49 +01:00
test.c -o posix: disable '[ -t ]' == '[ -t 1 ]' hack 2020-09-01 20:24:44 +01:00
trap.c Fix how unrecognized options are handled in 'sleep' and 'suspend' (#93) 2020-07-26 02:18:49 +01:00
typeset.c Reinstate 'r' and 'history' as preset aliases for interactive ksh 2020-09-11 21:35:45 +02: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 whence -a/type -a: report both function and built-in by same name 2020-07-20 21:16:24 +01:00