From 533bfa011622f2eb829e1310db0860ae8d3d75f3 Mon Sep 17 00:00:00 2001 From: Daniel Shahaf Date: Sun, 12 Jan 2020 17:10:34 +0000 Subject: [PATCH] '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. --- highlighters/main/main-highlighter.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/highlighters/main/main-highlighter.zsh b/highlighters/main/main-highlighter.zsh index b15246c..8dd861f 100644 --- a/highlighters/main/main-highlighter.zsh +++ b/highlighters/main/main-highlighter.zsh @@ -188,7 +188,7 @@ _zsh_highlight_main__type() { elif { [[ $1 != */* ]] || is-at-least 5.3 } && # Add a subshell to avoid a zsh upstream bug; see issue #606. # ### Remove the subshell when we stop supporting zsh 5.7.1 (I assume 5.8 will have the bugfix). - ! (builtin type -w -- $1) >/dev/null 2>&1; then + ! (builtin type -w -- "$1") >/dev/null 2>&1; then REPLY=none fi fi @@ -203,7 +203,7 @@ _zsh_highlight_main__type() { # starts with an arithmetic expression [«((…))» as the first thing inside # «$(…)»], which is area that has had some parsing bugs before 5.6 # (approximately). - REPLY="${$(:; (( aliases_allowed )) || unalias -- $1 2>/dev/null; LC_ALL=C builtin type -w -- $1 2>/dev/null)##*: }" + REPLY="${$(:; (( aliases_allowed )) || unalias -- "$1" 2>/dev/null; LC_ALL=C builtin type -w -- "$1" 2>/dev/null)##*: }" if [[ $REPLY == 'alias' ]]; then may_cache=0 fi