From 2e8f7e4d05dc737f7082625d8101beb408433dcd Mon Sep 17 00:00:00 2001 From: Than Ngo Date: Tue, 23 Mar 2021 19:57:58 +0100 Subject: [PATCH] fix regression in zsh --- which.spec | 5 ++++- which2.sh | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/which.spec b/which.spec index 3b01c37..de625a9 100644 --- a/which.spec +++ b/which.spec @@ -1,7 +1,7 @@ Summary: Displays where a particular program in your path is located Name: which Version: 2.21 -Release: 23%{?dist} +Release: 24%{?dist} License: GPLv3 Source0: http://ftp.gnu.org/gnu/which/%{name}-%{version}.tar.gz Source1: which2.sh @@ -40,6 +40,9 @@ rm -f $RPM_BUILD_ROOT%{_infodir}/dir %{_mandir}/man1/which.1* %changelog +* Tue Mar 23 2021 Than Ngo - 2.21-24 +- fix regression in zsh + * Sun Mar 21 2021 Than Ngo - 2.21-23 - improved which2.sh diff --git a/which2.sh b/which2.sh index 9b5e0b0..ce22d37 100644 --- a/which2.sh +++ b/which2.sh @@ -2,8 +2,9 @@ _declare="declare -f" _opt="-f" +_shell="$(basename $SHELL)" -if [ "$0" = "ksh" ] || [ "$0" = "-ksh" ] || [ "$0" = "mksh" ] || [ "$0" = "-mksh" ] ; then +if [ "$_shell" = "ksh" ] || [ "$_shell" = "mksh" ] || [ "$_shell" = "zsh" ] ; then _declare="typeset -f" _opt="" fi