1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-09-02 22:11:54 +02:00

Greg Klanderman: 27259 / 27260: unset parameter in file prefix

This commit is contained in:
Peter Stephenson 2009-09-10 15:56:39 +00:00
parent 4ede75ed0e
commit 13c5015b23

View file

@ -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='[^/]'