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
Johnothan King 102868f850 Replace the hash alias with a proper builtin
This commit replaces the old hash alias with a proper builtin.
I based this builtin off of the code alias uses for handling
`alias -t --`, but with the hack for `--` removed as it has
no use in the new builtin. `alias -t --` will no longer work,
that hack is now gone.

While I was testing this builtin, I found a bug with hash tables
in non-forking subshells. If the hash table of a non-forking
subshell is changed, the parent shell's hash table is also changed.
As an example, running `(hash -r)` was resetting the parent shell's
hash table. The workaround is to force the subshell to fork if the
hash table will be changed.

src/cmd/ksh93/bltins/typeset.c:
 - Move the code for hash out of the alias builtin into a dedicated
   hash builtin. `alias -t --` is no longer supported.

src/cmd/ksh93/data/aliases.c:
 - Remove the old alias for hash from the table of predefined aliases.

src/cmd/ksh93/data/builtins.c:
 - Fix the broken entry for the hash builtin and add a man page for
   the new builtin.

src/cmd/ksh93/sh.1:
 - Replace the entry for the hash alias with a more detailed entry
   for the hash builtin.

src/cmd/ksh93/sh/name.c:
 - Force non-forking subshells to fork if the PATH is being reset
   to workaround a bug with the hash tree.

src/cmd/ksh93/tests/alias.sh:
 - Add a regression test for resetting a hash table, then adding
   a utility to the refreshed hash table.

src/cmd/ksh93/tests/subshell.sh:
 - Add regression tests for changing the hash table in subshells.

(cherry picked from commit d8428a833afe9270b61745ba3d6df355fe1d5499)
2020-06-12 01:45:18 +02:00
..
argnod.h Version: 2012-08-01-master 2016-01-11 15:54:23 -05:00
builtins.h Replace the hash alias with a proper builtin 2020-06-12 01:45:18 +02:00
defs.h Fix 'test'/'[' exit status >1 on error in arithmetic expression 2020-06-12 01:45:15 +02:00
edit.h Fix 80 typos in comments 2020-06-12 01:45:12 +02:00
env.h Fix 80 typos in comments 2020-06-12 01:45:12 +02:00
fault.h Fix 80 typos in comments 2020-06-12 01:45:12 +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 rm "I/O error" error msg; just keep >0 exit status (re: 9011fa93) 2020-06-12 01:45:18 +02:00
jobs.h Fix 80 typos in comments 2020-06-12 01:45:12 +02:00
lexstates.h Fix 80 typos in comments 2020-06-12 01:45:12 +02:00
name.h Fix 80 typos in comments 2020-06-12 01:45:12 +02:00
national.h Version: 2012-08-01-master 2016-01-11 15:54:23 -05:00
nval.h Version: 2012-08-01-master 2016-01-11 15:54:23 -05:00
path.h Version: 2012-08-01-master 2016-01-11 15:54:23 -05:00
regress.h Version: 2012-08-01-master 2016-01-11 15:54:23 -05:00
shell.h Fix 80 typos in comments 2020-06-12 01:45:12 +02:00
shlex.h Version: 2012-08-01-master 2016-01-11 15:54:23 -05:00
shnodes.h Version: 2012-08-01-master 2016-01-11 15:54:23 -05:00
shtable.h Version: 2012-08-01-master 2016-01-11 15:54:23 -05:00
streval.h Version: 2012-08-01-master 2016-01-11 15:54:23 -05:00
terminal.h Fix 80 typos in comments 2020-06-12 01:45:12 +02:00
test.h Version: 2012-08-01-master 2016-01-11 15:54:23 -05: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 Remove code related to long-dead 3DFS research project 2020-06-12 01:45:17 +02:00
version.h POSIX compliance fix: apply 'set -u' to $1, $2, ... 2020-06-12 01:45:17 +02:00