Re: [BUG] regression in builtin echo

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
--
To unsubscribe from this list: send the line "unsubscribe dash" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [LARTC]     [Bugtraq]     [Yosemite Forum]     [Photo]

  Powered by Linux