aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2021-01-18Remove redundant blake2 mention and move base32 into the implemented list.Rob Landley
2021-01-15Cleanup base32 slightly.Rob Landley
2021-01-14A few more shell tests.Rob Landley
2021-01-13Fix "date -I" segfault and teach lib/args.c that "I(opt):;" short opt withRob Landley
no argument returns NULL same as --opt without =
2021-01-08chmod.test: fix the tests to work on mksh as well as bash.Elliott Hughes
mksh doesn't support the {a..b} bashism or the ${!name} bashism, causing the tests to fail on Android. This works for me on both mksh and bash (both tested on Debian).
2021-01-07new toy: base32Moritz Röhrich
Add new toy `base32`. Add tests for `base32`. base32 is added by adapting the base64 encode/decode function to also do base32 encoding/decoding. Then their respective main functions set up the global parameter `n` to be the number of bits used in the encoding (5 for base32 and 6 for base64) and `align` to align the result to a certain length via padding. These are deliberately kept as parameters to enable future expansion for other bases easily.
2021-01-06seq: always xwrite.Elliott Hughes
Pointed out by the compiler combined with glibc's use of __attribute__((__warn_unused_result__)) on write().
2021-01-06main.c: construct a combination locale to add UTF-8.Elliott Hughes
We need <xlocale.h> for newlocale(3) on macOS, despite it being in POSIX 2008's <locale.h>. musl apparently doesn't have <xlocale.h>, so that's another trick to teach to portability.h...
2021-01-01Fix comma regression reported by Denys Nykula.Rob Landley
2020-12-26toysh: fix break/continueRob Landley
2020-12-25toysh fixes and testsRob Landley
2020-12-25Add MacOS 11.0 to CI BuildsEric Molitor
2020-12-19Fix (( )) quote termination.Rob Landley
2020-12-19FS_ENCRYPT_FL introduced too recently to depend on, use constant.Rob Landley
Note: can't put in portability.h because it's a linux/ include.
2020-12-18Add seq INT_MIN test.Rob Landley
2020-12-18seq.c: fix itoa for INT_MIN in case itoa gets used elsewhere.Elliott Hughes
It can't actually be used for INT_MIN in the current context because the `dd += increment` on line 100 means that even if "last" is INT_MIN, we won't take the fast path because INT_MIN - 1 isn't representable.
2020-12-18Andy Hu wants mount -tnomsdos,smbfs to work.Rob Landley
2020-12-18Elliott said that chmod 000 debris was confusing host rm -rf, and macosRob Landley
couldn't handle chmod +s in /tmp. Try to make test_chmod clear out debris and teach make clean to chmod -R generated before deleting it.
2020-12-16chmod.c: mask out the file type bits.Elliott Hughes
The kernel will do this for us on both Linux and macOS, but error messages are a bit misleading if we don't do it ourselves --- it can look as if the failure is because of the type bits.
2020-12-15Speed up count: use 64k block size, update display at most 4x/second.Rob Landley
2020-12-15Implement set, trace support, and function call context stack.Rob Landley
2020-12-14main.c: fix UTF-8 on macOS.Elliott Hughes
Unfortunately neither "C.UTF-8" nor "UTF-8" works on *both* OSes...
2020-12-14Add test for FEXTRA flag on gunzipPuck Meerburg
2020-12-14Follow RFC1952 when consuming gzip headerPuck Meerburg
The FEXTRA field, indicated by bit 2 of the flag byte, contains arbitrary extra data, prefixed by a 16-bit length value. The previous code skipped over the length, but not the actual contents, breaking decompression of certain files.
2020-12-12Speed up seq: use toybuf for block writes and add an integer fast path.Rob Landley
2020-12-11Sigh, remove debug code checked in by mistake.Rob Landley
2020-12-11The "fall back to C.UTF-8" check was backwards, and make TOYFLAG_LINEBUFRob Landley
configurable.
2020-12-08Remove last traces of CONFIG_TOYBOX_I18N.Elliott Hughes
`make macos_defconfig` was grumbling.
2020-12-08Better conversion of toycans-big.jpg to png. (Just rotate 90 degrees.)Rob Landley
2020-12-07Rename randbuf and hook up -sRob Landley
2020-12-07Promote pwgen.Rob Landley
2020-12-07Cleanup pwgen as described on the list.Rob Landley
http://lists.landley.net/pipermail/toybox-landley.net/2020-December/012169.html
2020-12-07scripts/runtest.sh: fix `toyonly` in a way that also works for mksh.Elliott Hughes
mksh doesn't support the =~ extension, so my previous change -- while fixing the host -- broke Android.
2020-12-07sed: add 'x' flag to the 's' command.Elliott Hughes
The GNU tar manual, when talking about the `tar --transform` option that I need to implement, describes the 'x' flag by saying "regexp is an extended regular expression (see section 'Extended regular expressions' in GNU sed)". Only it turns out that even the latest GNU sed doesn't actually have that flag. It's unique to `tar --transform`. That link is just telling you that the sed manual will explain extended regular expressions, not that GNU sed also supports the 'x' flag. So I don't know whether we want this in toybox sed after all. (It made sense that sed would have such a flag, but no sed that I know of actually does.)
2020-12-06unicode: new toy.Elliott Hughes
Based loosely on the Plan9/Inferno utility, and a convenient way to go back and forth between code points and utf8 sequences. This patch also fixes a couple of bugs in wctoutf8 (and the tests for this toy effectively serve as unit tests for wctoutf8/utf8towc).
2020-12-06id.test: hacks to pass on Raspberry Pi OS.Elliott Hughes
The rest of `make tests` all pass on a Raspberry Pi 400.
2020-12-06Remove CONFIG_TOYBOX_I18N and just always support utf8.Rob Landley
2020-12-05Fix find empty argument handling and add test.Rob Landley
2020-12-05new toy: Add pwgenMoritz Röhrich
Add new toy `pwgen`. A usefule password generation utility.
2020-12-05tr: fix pathological flushing.Elliott Hughes
The AOSP build doesn't use tr (or anything that's still in pending), but the kernel folks have been more aggressive. They found that tr's pathological flushing was adding minutes to their build times. Just removing the fflush() made tr significantly faster for my trivial test, but still slow, with all the time going into stdio. Rewriting the loop to modify toybuf in place and then do one write per read made most of the difference, but special-casing the "neither -d nor -s" case made a measurable difference too on a Xeon. Bug: http://b/174773617
2020-12-05scripts/runtest.sh: fix `toyonly` for sed.Elliott Hughes
sed lies to fool autoconf, but also confuses the toybox test suite. Without this patch we're skipping all "toyonly" tests on both GNU and toybox sed.
2020-12-05Small cleanup.Rob Landley
2020-12-04chmod: support complex modes.Elliott Hughes
Change 5109da9b3e6a898c8e0ad647303a1b375e3d97d3 caused test.test to call chmod with mode `u+s+s` which passes on the host (where you have a toybox test but a GNU chmod) but fails on Android where chmod is toybox too. Add the missing loop to string_to_mode(), which means this will also affect other toys, but that seems like a feature (and, for example, GNU mkdir also accepts a mode like `a=r+w+x`).
2020-11-29true is mentioned twiceFiras Khalil Khana
2020-11-27toysh: Adjust $0 for scripts.Rob Landley
2020-11-25Minor tweaks.Rob Landley
2020-11-25Luke Frankart pointed out a typo (0x111 should be 0111). Fix and updateRob Landley
tests to catch this. While there add -k to test sticky bit.
2020-11-25Fix help text to explain why o+s isn't +t, add test +s not setting +t.Rob Landley
2020-11-22Minor cleanup.Rob Landley
2020-11-18Fix microcom to set serial device's terminal correctly.Rob Landley
Can't use the same set_terminal() logic as ptys because it not displaying data, it should just accurately copy it.