mirror of
git://git.code.sf.net/p/cdesktopenv/code
synced 2025-03-09 15:50:02 +00:00
Really stop affecting user command history (re: aff63e38
)
The fix was incomplete because some tests have to unset HISTFILE, which reverted them to using ~/.sh_history by default. src/cmd/ksh93/tests/shtests: - Instead of setting HISTFILE, set HOME to the temporary directory $tmp, so nothing will write to the real user directory and the default history file is $tmp/.sh_history. src/cmd/ksh93/tests/attributes.sh: - Restore HISTFILE after a test that requires setting HISTFILE=foo.
This commit is contained in:
parent
cadd1a81dc
commit
64d04e717b
2 changed files with 4 additions and 1 deletions
|
@ -408,10 +408,12 @@ typeset groupDB="" userDB=""
|
||||||
typeset -l -L1 DBPick=""
|
typeset -l -L1 DBPick=""
|
||||||
[[ -n "$groupDB" ]] && err_exit 'typeset -l -L1 causes unwanted side effect'
|
[[ -n "$groupDB" ]] && err_exit 'typeset -l -L1 causes unwanted side effect'
|
||||||
|
|
||||||
|
[[ -v HISTFILE ]] && saveHISTFILE=$HISTFILE || unset saveHISTFILE
|
||||||
HISTFILE=foo
|
HISTFILE=foo
|
||||||
typeset -u PS1='hello --- '
|
typeset -u PS1='hello --- '
|
||||||
HISTFILE=foo
|
HISTFILE=foo
|
||||||
[[ $HISTFILE == foo ]] || err_exit 'typeset -u PS1 affects HISTFILE'
|
[[ $HISTFILE == foo ]] || err_exit 'typeset -u PS1 affects HISTFILE'
|
||||||
|
[[ -v saveHISTFILE ]] && HISTFILE=$saveHISTFILE || unset HISTFILE
|
||||||
|
|
||||||
typeset -a a=( aA= ZQ= bA= bA= bw= Cg= )
|
typeset -a a=( aA= ZQ= bA= bA= bw= Cg= )
|
||||||
typeset -b x
|
typeset -b x
|
||||||
|
|
|
@ -298,7 +298,8 @@ else trap 'cd / && rm -rf "$tmp"' EXIT
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# for interactive shell ('ksh -i') tests: avoid affecting ~/.sh_history
|
# for interactive shell ('ksh -i') tests: avoid affecting ~/.sh_history
|
||||||
export HISTFILE=$tmp/sh_history
|
# (some tests must unset or modify $HISTFILE, so set $HOME instead)
|
||||||
|
export HOME=$tmp
|
||||||
|
|
||||||
if (( compile ))
|
if (( compile ))
|
||||||
then if whence $SHCOMP > /dev/null
|
then if whence $SHCOMP > /dev/null
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue