about summary refs log tree commit diff
diff options
context:
space:
mode:
authorClint Adams <clint@users.sourceforge.net>2002-01-27 21:57:52 +0000
committerClint Adams <clint@users.sourceforge.net>2002-01-27 21:57:52 +0000
commita92fca6f8e326d72b5041281341093473f5a1fa4 (patch)
tree14e9637c7eed00e92bfc7deaeee97630bed11038
parentfc25322fa38b184aadefe0bd5d50e3bc06122511 (diff)
downloadzsh-a92fca6f8e326d72b5041281341093473f5a1fa4.tar.gz
zsh-a92fca6f8e326d72b5041281341093473f5a1fa4.tar.xz
zsh-a92fca6f8e326d72b5041281341093473f5a1fa4.zip
16500: don't complete executable files in the current directory if "." is not in path.
-rw-r--r--ChangeLog6
-rw-r--r--Completion/Zsh/Type/_command_names11
2 files changed, 16 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index d1b6f08d0..ef7c6c44f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2002-01-27  Clint Adams  <clint@zsh.org>
+
+	* 16500: Completion/Zsh/Type/_command_names:
+	don't complete executable files in the current directory
+	if "." is not in path.
+
 2002-01-23  Bart Schaefer  <schaefer@zsh.org>
 
 	* 16435: Src/builtin.c: Fix core dump in `hash'.
diff --git a/Completion/Zsh/Type/_command_names b/Completion/Zsh/Type/_command_names
index 006006348..71c3adfd2 100644
--- a/Completion/Zsh/Type/_command_names
+++ b/Completion/Zsh/Type/_command_names
@@ -8,9 +8,18 @@ local args defs
 
 defs=(
   'commands:external command:compadd -k commands'
-  'executables:executable file or directory:_path_files -/g \*\(-\*\)'
 )
 
+if [[ -n "$path[(r).]" ]]; then
+  defs=( "$defs[@]"
+         'executables:executable file or directory:_path_files -/g \*\(-\*\)'
+  )
+else
+  defs=( "$defs[@]"
+         'executables:executable file or directory:_files -P/ -W/ -/g \*\(-\*\)'
+  )
+fi
+
 if [[ "$1" = -e ]]; then
   shift
 else