From 13c5015b231d4c401ed616732d19d50531b0bb34 Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Thu, 10 Sep 2009 15:56:39 +0000 Subject: Greg Klanderman: 27259 / 27260: unset parameter in file prefix --- Completion/Unix/Type/_path_files | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'Completion/Unix/Type') 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='[^/]' -- cgit 1.4.1