'main': Fix a bug concerning command word with embedded colon-space sequences.

Such a command word would, if not valid, fall through to the `type -w` case,
where the output would be misparsed, consequently the forward-compatible [arg0]
style would be used.
This commit is contained in:
Daniel Shahaf
2016-11-02 03:14:53 +00:00
parent 626c034c68
commit fed37a90ac
2 changed files with 36 additions and 1 deletions

View File

@@ -147,7 +147,7 @@ _zsh_highlight_main__type() {
fi
fi
if ! (( $+REPLY )); then
REPLY="${$(LC_ALL=C builtin type -w -- $1 2>/dev/null)#*: }"
REPLY="${$(LC_ALL=C builtin type -w -- $1 2>/dev/null)##*: }"
fi
if (( $+_zsh_highlight_main__command_type_cache )); then
_zsh_highlight_main__command_type_cache[(e)$1]=$REPLY