From: Peter Stephenson <p.stephenson@samsung.com>
To: zsh-workers@zsh.org
Subject: Re: broken parsing with $((`:`))
Date: Wed, 15 Apr 2015 16:37:30 +0100 [thread overview]
Message-ID: <20150415163730.75f2e7ee@pwslap01u.europe.root.pri> (raw)
In-Reply-To: <150415081348.ZM26219@torch.brasslantern.com>
On Wed, 15 Apr 2015 08:13:48 -0700
Bart Schaefer <schaefer@brasslantern.com> wrote:
> On Apr 15, 10:03am, Peter Stephenson wrote:
> }
> } Yes, indeed --- there's a funny internal special case for empty strings
> } that I never quite get my head around.
> }
> } - if (!*s) {
> } + if (!*s || *s == Nularg) {
>
> I wonder if (a) there are other overlooked cases like this and (b) if it
> would be useful to have a #define macro for (c == '\0' || c == Nularg).
> A quick grep doesn't find existing cases of that test other than this
> new one, but of course if the Nularg part were forgotten, it wouldn't.
Just looked and the typical tests for Nularg are:
- We get it as a single character so just ignore it because there's a '\0'
next which the following code will handle normally;
- We look for Nularg in a string and skip over the character because
ditto (we could have made the math.c cases follow this form);
- In a few cases we explicitly check to see if there was a '\0'
after the Nularg --- possibly me being cautious because I don't really
know what's going on; I think that's actually unnecessary because
Nularg means the whole string is empty.
(- Not directly relevant but in prompt.c we look to see if there's a
Nularg we can backup over, which is probably really cool.)
pws
next prev parent reply other threads:[~2015-04-15 15:37 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-15 3:05 Mike Frysinger
2015-04-15 9:03 ` Peter Stephenson
2015-04-15 15:13 ` Bart Schaefer
2015-04-15 15:26 ` Peter Stephenson
2015-04-15 16:23 ` Potential 3.0.8 [was Re: broken parsing with $((`:`))] Bart Schaefer
2015-04-22 9:01 ` Peter Stephenson
2015-04-25 17:14 ` Pre-3.0.8 consolidated PATCH Bart Schaefer
2015-04-25 18:29 ` Axel Beckert
2015-04-25 18:46 ` FIVE-ZERO-EIGHT (was Re: Pre-3.0.8 consolidated PATCH) Bart Schaefer
2015-08-15 23:14 ` bug with expansion and backslashes Oliver Kiddle
2015-08-16 1:22 ` Bart Schaefer
2015-04-15 15:37 ` Peter Stephenson [this message]
2015-04-15 16:13 ` broken parsing with $((`:`)) Bart Schaefer
2015-04-15 16:31 ` Peter Stephenson
2015-04-17 4:39 Mikael Magnusson
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=20150415163730.75f2e7ee@pwslap01u.europe.root.pri \
--to=p.stephenson@samsung.com \
--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).