From: Peter Stephenson <p.stephenson@samsung.com>
To: zsh-workers@zsh.org
Subject: Re: free() error on simple input scripts
Date: Tue, 09 Dec 2014 17:30:47 +0000 [thread overview]
Message-ID: <20141209173047.3541fdc9@pwslap01u.europe.root.pri> (raw)
In-Reply-To: <E9488576-E38D-44C7-A62B-8DC31AABB310@kba.biglobe.ne.jp>
On Wed, 10 Dec 2014 00:45:42 +0900
Jun T. <takimoto-j@kba.biglobe.ne.jp> wrote:
> 2014/12/07 15:36, Bart Schaefer <schaefer@brasslantern.com> wrote:
>
> > source =(<<<$'d\\\0')
>
> The input backslash-null is metafiled by shingetline() to
> backslash-meta-space (since 0 xor 32 = 32 = ' '), but it seems
> the lexer does not treat the meta after backslash specially and
> interprets the space as a word separator; this results in a
> word ending with meta.
>
> What is the "correct" behavior for the input backslash-null?
> The following may be a possibility but I'm not sure.
> (The ifdef DEBUG part is copied from line 1059 in the same file)
I *think* your patch is correct.
Certainly, it is valid to get metafied input at the lexer. See for
example the end of zleread() which calls zlegetline() which calls
zlelineasstring (typically --- unless we already have a metafied line)
which metafies the line that's about to be returned.
I'm a bit surprised the lexer doesn't have more cases like this, or a
more general way of dealing with metafied characters, but handling a
backslash the way you suggest looks perfectly OK. However, wait and see
what Bart says, too.
pws
next prev parent reply other threads:[~2014-12-09 17:30 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-06 4:27 Dennis Felsing
2014-12-06 23:07 ` Bart Schaefer
2014-12-07 6:36 ` Bart Schaefer
2014-12-09 15:45 ` Jun T.
2014-12-09 17:30 ` Peter Stephenson [this message]
2014-12-09 22:13 ` Bart Schaefer
2014-12-08 12:51 ` Jun T.
2014-12-08 16:37 ` Bart Schaefer
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=20141209173047.3541fdc9@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).