Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > gnu.bash.bug > #16188

Re: %q with truncating size loses safeness of %q

From Robert Elz <kre@munnari.OZ.AU>
Newsgroups gnu.bash.bug
Subject Re: %q with truncating size loses safeness of %q
Date 2020-04-20 20:44 +0700
Message-ID <mailman.784.1587390331.3066.bug-bash@gnu.org> (permalink)
References (2 earlier) <4bacf2f0-9802-67d3-f30b-80e37d058a4a@case.edu> <CAOj-5WCqxqh=Gcda9k6y4orQaQYXPgsOgNEOVN1AdZQrkCVbtg@mail.gmail.com> <22039.1587163072@jinx.noi.kre.to> <29253.1587332029@jinx.noi.kre.to> <8940.1587390294@jinx.noi.kre.to>

Show all headers | View raw


    Date:        Mon, 20 Apr 2020 09:03:39 -0400
    From:        Chet Ramey <chet.ramey@case.edu>
    Message-ID:  <51b585da-b594-740d-1772-3c3a25a89325@case.edu>

  | I'm referring to the specification of %b that I quoted in another message,

I didn't see that (and I certainly didn't comment on it wrt rationality).

  | which uses the precision after the argument is expanded.

Yes, %b is a hard case, neither way makes a lot of sense to use the
precision, certainly truncating the input string half way through an
escape sequence would be absurd, so if the precision needs to do
anything at all, having it apply to the expanded string makes more
sense than having it apply to the input.  Using the precision with a
%b expansion probably indicates a user who isn't really thinking though.

%q however is different, there applying the precision to the quoted
string is ludicrous (but easy to implement), whereas applying it to
the input can be useful (but means more work).

kre

Back to gnu.bash.bug | Previous | Next | Find similar


Thread

Re: %q with truncating size loses safeness of %q Robert Elz <kre@munnari.OZ.AU> - 2020-04-20 20:44 +0700

csiph-web