[Toybox] [PATCH] find: support -printf \0 octal escapes and \c.

Rob Landley rob at landley.net
Mon Sep 2 15:51:57 PDT 2019


On 9/2/19 4:19 PM, enh wrote:
> On Sun, Sep 1, 2019 at 6:18 PM Rob Landley <rob at landley.net> wrote:
> (as an aside, i still haven't understood \c. i've never seen it used
> in practice, and the examples i've seen are all of the form "x\cy"
> which would be better written as just "x".)

I think it's so echo "$ONE$TWO" can have $ONE end with something that prevents
$TWO from mattering? Dunno.

>> Yay tests,
> 
> one concern i have here is that we're copying the cigarette burns
> (https://www.wired.com/1995/09/tognazzini/).

I'd send you a link to the Babylon 5 bit where G'Kar's book was copied exactly
including Girabaldi's coffee stain, but I'm not digging enough to find it on
youtube just now.

> does anyone actually benefit from all these slightly different
> behaviors? is anything relying on it? (different behaviors for invalid
> octal escapes, say, seems somewhat likely to matter in practice. "find
> doesn't support \x", though, seems very unlikely to me. especially
> because GNU considers that an error.)

This is why I wait for people to complain before opening various cans of worms,
_but_ once I'm implementing something I try to do it right. (I.E. if I'm gonna
support \0, do it as a side effect of octal.)

And if I _can_ implement things using common code (such as collating the 3
implementations here), and this winds up implementing extra features, I'm not
going to spend code _disabling_ the extra features. (That's why just about every
toybox command line numerical input supports units.)

Rob



More information about the Toybox mailing list