dash.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jilles Tjoelker <jilles@stack.nl>
To: Herbert Xu <herbert@gondor.apana.org.au>
Cc: Harald van Dijk <harald@gigawatt.nl>,
	luigi.tarenga@gmail.com, dash@vger.kernel.org
Subject: Re: [BUG] regression in builtin echo
Date: Fri, 2 Sep 2016 17:24:59 +0200	[thread overview]
Message-ID: <20160902152459.GC87540@stack.nl> (raw)
In-Reply-To: <20160902141912.GA12739@gondor.apana.org.au>

On Fri, Sep 02, 2016 at 10:19:12PM +0800, Herbert Xu wrote:
> On Fri, Sep 02, 2016 at 04:16:31PM +0200, Jilles Tjoelker wrote:

> > Unlike Harald van Dijk's patch, the above patch breaks \c. Per POSIX
> > (XSI option), \c shall cause all characters following it in the
> > arguments to be ignored (so not only in the argument where \c occurs).
> > For example:
> >   echo 'a\cb' c; echo d
> > shall write "ad" followed by a newline.

> Works for me:

> $ build/src/dash -c "echo 'a\cb' c; echo d"
> ad
> $ 

> AFAICS my patch doesn't change \c handling at all.  When we hit
> \c print_escape_str will return 0x100, which guarantees that we
> hit the berak.

You are right. The code is very tricky and my analysis without running
the code was wrong.

I think developing a shell is hard enough already without making the
code so tricky, though.

Jilles Tjoelker

      reply	other threads:[~2016-09-02 15:25 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CAKkO-EgCkv48unwXBjN1JdjSNx3_D1yCZQhde7WJedOFRUDaGg@mail.gmail.com>
2016-09-01 20:18 ` [BUG] regression in builtin echo Harald van Dijk
2016-09-02 13:14   ` Herbert Xu
2016-09-02 14:16     ` Jilles Tjoelker
2016-09-02 14:19       ` Herbert Xu
2016-09-02 15:24         ` Jilles Tjoelker [this message]

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:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160902152459.GC87540@stack.nl \
    --to=jilles@stack.nl \
    --cc=dash@vger.kernel.org \
    --cc=harald@gigawatt.nl \
    --cc=herbert@gondor.apana.org.au \
    --cc=luigi.tarenga@gmail.com \


* 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.
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).