[Toybox] [PATCH] tr.c: added -t option and cleanup up formatting

Oliver Webb aquahobbyist at proton.me
Fri Oct 20 21:22:22 PDT 2023


Heya, I noticed that tr was in pending, taking a look at the source code.
It doesn't look very unclean, nor does it fail any test cases. The only 2 things
in the TODO are -t and -a. Neither POSIX or GNU tr specify a -a[scii] option.
The name gives a general idea of what it's supposed to do 
(Stop acting utf-8 safe and treat everything as extended ASCII?)

I added in a -t[runcate] option and a corresponding test case.

I also cleaned up some of code (foobar[0] to *foobar, removing sizeof(char), etc)

- Oliver Webb <aquahobbyist at proton.me>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Added-tr-t-and-test-case-for-it-Minor-formatting-cle.patch
Type: text/x-patch
Size: 4582 bytes
Desc: not available
URL: <http://lists.landley.net/pipermail/toybox-landley.net/attachments/20231021/00d8209a/attachment.bin>


More information about the Toybox mailing list