mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-09-10 12:40:58 +02:00
Greg Klanderman: 27259 / 27260: unset parameter in file prefix
This commit is contained in:
parent
4ede75ed0e
commit
13c5015b23
1 changed files with 5 additions and 1 deletions
|
@ -247,7 +247,11 @@ if [[ "$pre" = [^][*?#^\|\<\>\\]#(\`[^\`]#\`|\$)*/* && "$compstate[quote]" != \'
|
||||||
# meant as a partial path.
|
# meant as a partial path.
|
||||||
|
|
||||||
linepath="${(M)pre##*\$[^/]##/}"
|
linepath="${(M)pre##*\$[^/]##/}"
|
||||||
|
function {
|
||||||
|
# do not treat an unset parameter expansion as the empty string
|
||||||
|
setopt localoptions nounset
|
||||||
eval 'realpath=${(e)~linepath}' 2>/dev/null
|
eval 'realpath=${(e)~linepath}' 2>/dev/null
|
||||||
|
}
|
||||||
[[ -z "$realpath" || "$realpath" = "$linepath" ]] && return 1
|
[[ -z "$realpath" || "$realpath" = "$linepath" ]] && return 1
|
||||||
pre="${pre#${linepath}}"
|
pre="${pre#${linepath}}"
|
||||||
i='[^/]'
|
i='[^/]'
|
||||||
|
|
Loading…
Reference in a new issue