about summary refs log tree commit diff
path: root/Completion
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2009-09-10 15:56:39 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2009-09-10 15:56:39 +0000
commit13c5015b231d4c401ed616732d19d50531b0bb34 (patch)
treef9a8e177309b5b89a8e591e6eb84cccf78475a5a /Completion
parent4ede75ed0e6dfafad5f5b9a621ac7a3d31765e1a (diff)
downloadzsh-13c5015b231d4c401ed616732d19d50531b0bb34.tar.gz
zsh-13c5015b231d4c401ed616732d19d50531b0bb34.tar.xz
zsh-13c5015b231d4c401ed616732d19d50531b0bb34.zip
Greg Klanderman: 27259 / 27260: unset parameter in file prefix
Diffstat (limited to 'Completion')
-rw-r--r--Completion/Unix/Type/_path_files6
1 files changed, 5 insertions, 1 deletions
diff --git a/Completion/Unix/Type/_path_files b/Completion/Unix/Type/_path_files
index 8bc9373a1..2e851058f 100644
--- a/Completion/Unix/Type/_path_files
+++ b/Completion/Unix/Type/_path_files
@@ -247,7 +247,11 @@ if [[ "$pre" = [^][*?#^\|\<\>\\]#(\`[^\`]#\`|\$)*/* && "$compstate[quote]" != \'
   # meant as a partial path.
 
   linepath="${(M)pre##*\$[^/]##/}"
-  eval 'realpath=${(e)~linepath}' 2>/dev/null
+  function {
+    # do not treat an unset parameter expansion as the empty string
+    setopt localoptions nounset
+    eval 'realpath=${(e)~linepath}' 2>/dev/null
+  }
   [[ -z "$realpath" || "$realpath" = "$linepath" ]] && return 1
   pre="${pre#${linepath}}"
   i='[^/]'