zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <p.w.stephenson@ntlworld.com>
To: "Jun. T" <takimoto-j@kba.biglobe.ne.jp>, zsh-workers@zsh.org
Subject: Re: (LC_ALL=C; set -x 128 129; printf "%s\n" ${(#)@} | hexdump -C)
Date: Mon, 11 Sep 2023 09:57:22 +0100 (BST)	[thread overview]
Message-ID: <968697743.3642134.1694422642580@mail.virginmedia.com> (raw)
In-Reply-To: <64346084-434A-4A42-AD56-44809DA2E54C@kba.biglobe.ne.jp>

> On 08/09/2023 17:30 Jun. T <takimoto-j@kba.biglobe.ne.jp> wrote:
> > 2023/09/08 1:33, Peter Stephenson <p.w.stephenson@ntlworld.com> wrote:
> > 
> > Looks like these are the only calls to substevalchar(), so perhaps
> > the changes could be made internal to that.
> 
> I changed paramsubst() just because we can assume errflag=0 at the
> start of the block (and would make the things simpler.).
> 
> But, anyway, my previous patch was not complete.
> Either with or without my previous patch (in any locale):
> 
> % echo ${(#X):-@}
> zsh: bad math expression: illegal character: @
> 
> This is OK. But:
> 
> % printf "%s\n" ${(#):-@} | hexdump -C 
> 00000000  22 0a 22                                          |"."|
> 00000003
> 
> The quote removal is done in remnulargs() ( at subst.c:169).
> So it seems that if noerrs is set (without (X) flag) then we should not
> quit from prefork() at line 146. This means, I guess, substevalchar()
> should not return NULL if noerrs is set. But if we want to continue
> even if we have a bad math expression, only thing we can do is just
> to return "" instead of NULL. The patch below (hopefuly) does this.
> Any comment is welcome.

I think that's fine --- it's the sort of thing where we'll only find
out if there are issues when someone comes up with a new corner case.
Thanks.

pws


  reply	other threads:[~2023-09-11  8:57 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-30  7:27 Stephane Chazelas
2023-08-30 19:45 ` Bart Schaefer
2023-08-31 17:38   ` Jun. T
2023-09-07 14:26     ` Jun. T
2023-09-07 16:33       ` Peter Stephenson
2023-09-08 16:30         ` Jun. T
2023-09-11  8:57           ` Peter Stephenson [this message]
2023-09-11 12:11             ` Jun. T
2023-09-13  9:59               ` Jun T
2023-09-21  9:26                 ` Jun T

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=968697743.3642134.1694422642580@mail.virginmedia.com \
    --to=p.w.stephenson@ntlworld.com \
    --cc=takimoto-j@kba.biglobe.ne.jp \
    --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).