[Toybox] [PATCH] Make yesno printf-like.

Rob Landley rob at landley.net
Wed Sep 2 20:17:17 PDT 2015


On 09/02/2015 08:25 PM, Rich Felker wrote:
> On Wed, Sep 02, 2015 at 07:58:18PM -0500, Rob Landley wrote:
> This should work:
> 
> ([^%]|%%)*%[-#0 +']?[0-9]*.[0-9]*[aAeEfFgG]([^%]|%%)*

I just open coded it. (For a static single build not including the regex
plumbing is probably a win. For dynamic it's probably not big enough to
matter.)

> If you're already linking regcomp/regexec, using them to match it is
> probably the smallest/simplest implementation. If not you can write a
> state machine for it.

Dunno about state machine but I wrote a function that did it. :)

> Rich

Rob

 1441250237.0


More information about the Toybox mailing list