From: Stephane Chazelas <stephane@chazelas.org>
To: Zsh hackers list <zsh-workers@zsh.org>
Subject: [PATCH] is-at-least compares zsh's version if $2 is provided but empty
Date: Sun, 28 May 2023 12:39:07 +0100 [thread overview]
Message-ID: <20230528113907.hvxjuu4wwmettr5p@chazelas.org> (raw)
autoload is-at-least
is-at-least 7.2 "$(gcc -dumpfullversion 2> /dev/null)" ||
die "need gcc 7.2 or newer"
Will fail to detect gcc not being available or from a
version that didn't support -dumpfullversion when zsh 7.2 is
out, because when the second argument is empty, is-at-least
falls back to comparing zsh's own version instead.
IMO, it should check whether $2 is provided or not rather than
non-empty or not.
diff --git a/Functions/Misc/is-at-least b/Functions/Misc/is-at-least
index d4ff3552a..9546cb2b7 100644
--- a/Functions/Misc/is-at-least
+++ b/Functions/Misc/is-at-least
@@ -25,7 +25,7 @@ emulate -L zsh
local IFS=".-" min_cnt=0 ver_cnt=0 part min_ver version order
min_ver=(${=1})
-version=(${=2:-$ZSH_VERSION} 0)
+version=(${=2-$ZSH_VERSION} 0)
while (( $min_cnt <= ${#min_ver} )); do
while [[ "$part" != <-> ]]; do
next reply other threads:[~2023-05-28 11:39 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-28 11:39 Stephane Chazelas [this message]
2023-05-28 15:51 ` Mikael Magnusson
2023-06-01 18:23 ` [PATCHv2] " Stephane Chazelas
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230528113907.hvxjuu4wwmettr5p@chazelas.org \
--to=stephane@chazelas.org \
--cc=zsh-workers@zsh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).