From f7c766fb9ee44455dcb5d40995d952f501ecf8d2 Mon Sep 17 00:00:00 2001 From: Hamilton Turner Date: Fri, 6 Jun 2014 01:39:51 -0400 Subject: [PATCH] Fixed wd plugin bug on zsh <= 4.3.10 See http://www.zsh.org/mla/workers/2014/msg00501.html for details. At time of writing, some RedHat and CentOS still have 4.3.10 as the most up-to-date zsh in their package managers, so this should allow wd to work on those systems properly. --- plugins/wd/wd.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/wd/wd.sh b/plugins/wd/wd.sh index 96a3426fc..f1ed76fe3 100755 --- a/plugins/wd/wd.sh +++ b/plugins/wd/wd.sh @@ -64,9 +64,9 @@ wd_warp() wd_add() { - if [[ $2 =~ "^\.+$" || $2 =~ "^\s*$" ]] + if [[ $2 -regex-match "^\.+$" || $2 -regex-match "^\s*$" ]] then - wd_print_msg $RED "Illegal warp point (see README)." + wd_print_msg $RED "Warp point name cannot be just dots or spaces" elif [[ ${points[$2]} == "" ]] || $1 then wd_remove $2 > /dev/null