zsh-workers
 help / color / mirror / code / Atom feed
From: Oliver Kiddle <opk@zsh.org>
To: zsh-workers@zsh.org
Subject: Re: [BUG] POSIX arith: inf, nan should be variables
Date: Sun, 28 Nov 2021 21:34:41 +0100	[thread overview]
Message-ID: <53575-1638131681.212237@WIRp.dqll.oMb9> (raw)
In-Reply-To: <20211116125522.GA121624@zira.vinc17.org>

On 16 Nov, Vincent Lefevre wrote:
> On 2021-11-15 18:40:17 +0100, Martijn Dekker wrote:
> > $ zsh --emulate sh -c 'inf=1; nan=2; echo $((inf)) $((nan))'
> > Inf NaN
> > 
> > Expected: 1 2
>
> FYI, this had already been discussed in April in this subthread:

And it'll probably come up again if we don't do anything. Unless anyone
has better ideas, I'm inclined to go with the following variant of
Martijn's patch.

Oliver

diff --git a/Src/math.c b/Src/math.c
index 4f24361a4..777ad9c31 100644
--- a/Src/math.c
+++ b/Src/math.c
@@ -863,7 +863,7 @@ zzlex(void)
 
 		p = ptr;
 		ptr = ie;
-		if (ie - p == 3) {
+		if (ie - p == 3 && !EMULATION(EMULATE_SH)) {
 		    if ((p[0] == 'N' || p[0] == 'n') &&
 			(p[1] == 'A' || p[1] == 'a') &&
 			(p[2] == 'N' || p[2] == 'n')) {


  reply	other threads:[~2021-11-28 20:34 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-15 17:40 Martijn Dekker
2021-11-16  9:06 ` Oliver Kiddle
2021-11-16 12:55 ` Vincent Lefevre
2021-11-28 20:34   ` Oliver Kiddle [this message]
2021-12-01  3:31     ` Daniel Shahaf
2021-12-01  3:37       ` Bart Schaefer
2021-12-01  4:27         ` Writing XFail tests (was: Re: [BUG] POSIX arith: inf, nan should be variables) Daniel Shahaf

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=53575-1638131681.212237@WIRp.dqll.oMb9 \
    --to=opk@zsh.org \
    --cc=zsh-workers@zsh.org \
    --subject='Re: [BUG] POSIX arith: inf, nan should be variables' \
    /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

Code repositories for project(s) associated with this 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).