summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorjilles <jilles@FreeBSD.org>2011-02-05 14:01:46 +0000
committerjilles <jilles@FreeBSD.org>2011-02-05 14:01:46 +0000
commit852a80acf72e4c96489249a2958546b2155b3f2b (patch)
tree84915aacc0d57994a9e01403afbe1241feeb0859 /tools
parenta81357fbe93ddb2be80ff1401450234c412c135d (diff)
downloadFreeBSD-src-852a80acf72e4c96489249a2958546b2155b3f2b.zip
FreeBSD-src-852a80acf72e4c96489249a2958546b2155b3f2b.tar.gz
sh: Forget all cached command locations on any PATH change.
POSIX requires this and it is simpler than the previous code that remembered command locations when appending directories to PATH. In particular, PATH=$PATH is no longer a no-op but discards all cached command locations.
Diffstat (limited to 'tools')
-rw-r--r--tools/regression/bin/sh/execution/hash1.012
1 files changed, 12 insertions, 0 deletions
diff --git a/tools/regression/bin/sh/execution/hash1.0 b/tools/regression/bin/sh/execution/hash1.0
new file mode 100644
index 0000000..a645c2a
--- /dev/null
+++ b/tools/regression/bin/sh/execution/hash1.0
@@ -0,0 +1,12 @@
+# $FreeBSD$
+
+T=`mktemp -d "${TMPDIR:-/tmp}/sh-test.XXXXXXXX"` || exit
+trap 'rm -rf "${T}"' 0
+PATH=$T:$PATH
+ls -ld . >/dev/null
+cat <<EOF >"$T/ls"
+:
+EOF
+chmod 755 "$T/ls"
+PATH=$PATH
+ls -ld .
OpenPOWER on IntegriCloud