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:
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.
|
||||
|
||||
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='[^/]'
|
||||
|
|
Loading…
Reference in a new issue