From: Daniel Shahaf <d.s@daniel.shahaf.name>
To: Peter Stephenson <p.stephenson@samsung.com>
Cc: zsh-workers@zsh.org
Subject: Re: PATCH Re: 5.3: printf -
Date: Wed, 14 Dec 2016 16:51:48 +0000 [thread overview]
Message-ID: <20161214165148.GA16528@fujitsu.shahaf.local2> (raw)
In-Reply-To: <20161214093922.40d1eec2@pwslap01u.europe.root.pri>
Peter Stephenson wrote on Wed, Dec 14, 2016 at 09:39:22 +0000:
> On Tue, 13 Dec 2016 20:48:15 -0800
> Bart Schaefer <schaefer@brasslantern.com> wrote:
> > Apparently this was introduced in 37467 when I changed "printf" from
> > having no options at all to having the -v option for print-to-variable.
> >
> > There's some documentation saying that ideally we would not create any
> > new builtins with BINF_SKIPINVALID but I don't see any other way to get
> > back the old behavior.
>
> This was in any case ignoring the vagaries of traditional shell
> behaviour, which demand inconsistency. Supporting printf -v but
> treating a - without a following alphanumeric as part of the string,
> which seem to be the requirements we're faced with, aren't really
> consistent. So I think anything that works goes here.
The grandparent patch fixes all the cases given so far in this thread,
except that «printf --» and «printf -- -» yield an error and "-",
respectively — whereas in sh mode they should both print "--".
I'd tried to split the printf logic out of bin_print() [lines 4648
through end of function] in order to pave the way for a separate
bin_printf(), but with little success.
Thanks,
Daniel
next prev parent reply other threads:[~2016-12-14 17:01 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-12 23:41 Daniel Shahaf
2016-12-13 4:21 ` Bart Schaefer
2016-12-13 6:25 ` Daniel Shahaf
2016-12-14 4:48 ` PATCH " Bart Schaefer
2016-12-14 9:39 ` Peter Stephenson
2016-12-14 16:51 ` Daniel Shahaf [this message]
2016-12-14 18:44 ` Bart Schaefer
2016-12-15 0:50 ` Daniel Shahaf
2016-12-15 1:14 ` Chet Ramey
2016-12-15 22:45 ` Daniel Shahaf
2016-12-15 23:48 ` Chet Ramey
2016-12-16 0:56 ` Daniel Shahaf
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=20161214165148.GA16528@fujitsu.shahaf.local2 \
--to=d.s@daniel.shahaf.name \
--cc=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).