Skip to content

Commit 533bfa0

Browse files
committed
'main': Fix the new 'backslash' test on zsh-5.0.2 and older. (The bug
occurred on zsh-5.0.7 and older but I don't have zsh-5.0.7 handy to test on.) Evidently, the issue was due to elision. This addresses #665.0 and #665.5.
1 parent 2d0dddf commit 533bfa0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

highlighters/main/main-highlighter.zsh

+2-2
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ _zsh_highlight_main__type() {
188188
elif { [[ $1 != */* ]] || is-at-least 5.3 } &&
189189
# Add a subshell to avoid a zsh upstream bug; see issue #606.
190190
# ### Remove the subshell when we stop supporting zsh 5.7.1 (I assume 5.8 will have the bugfix).
191-
! (builtin type -w -- $1) >/dev/null 2>&1; then
191+
! (builtin type -w -- "$1") >/dev/null 2>&1; then
192192
REPLY=none
193193
fi
194194
fi
@@ -203,7 +203,7 @@ _zsh_highlight_main__type() {
203203
# starts with an arithmetic expression [«((…))» as the first thing inside
204204
# «$(…)»], which is area that has had some parsing bugs before 5.6
205205
# (approximately).
206-
REPLY="${$(:; (( aliases_allowed )) || unalias -- $1 2>/dev/null; LC_ALL=C builtin type -w -- $1 2>/dev/null)##*: }"
206+
REPLY="${$(:; (( aliases_allowed )) || unalias -- "$1" 2>/dev/null; LC_ALL=C builtin type -w -- "$1" 2>/dev/null)##*: }"
207207
if [[ $REPLY == 'alias' ]]; then
208208
may_cache=0
209209
fi

0 commit comments

Comments
 (0)