aboutsummaryrefslogtreecommitdiff
path: root/toys/pending
AgeCommit message (Collapse)Author
2021-03-17vi: various fixes.Elliott Hughes
I've been using toybox vi as a makeshift "less" lately. This patch contains all the fixes I've made... $ should go to the last character before the newline, not the newline. Fix ^b and ^f, and ^e and ^y (which was mistakenly ^u before, which is also a movement key, but half of ^d/^u, neither of which we actually implement, and neither of which I've ever used myself --- I might have large hands, but they're not _that_ large). Fix the display of lines longer than 1024 characters. Fix the display of the "~"s after the end of the file, and use VT100 dim to make it a bit more obvious that they're not actually part of the file. Also be a bit more consistent about \033 which is the most common way to write \x1b in toybox. Don't show the status while in ex mode. Make what the status is showing a little less unclear by adding a "C" for the byte offset and file size, and add a percentage (albeit one based on bytes rather than lines). Fix the flickering seen on updates with the usual stupid trick of setting a large buffer. Handle SIGWINCH. Add support for Home/End/PageUp/PageDown. Remove a bit of duplication around calls to draw_page().
2021-03-17Add local variables and basic function() support plumbing.Rob Landley
Not fully wired up yet, probably a bunch of regressions.
2021-02-23dd: simplify signal handling and fix status output.Elliott Hughes
Other dd implementations always show the status on exit, whether success or failure. Fix that by using xsigatexit() (and clarify the comment for that function a little, since it didn't previously address the "at exit" part of its behavior at all). This also fixes SIGUSR1 behavior so that we show the status immediately rather than on the next trip round the read/write loop. Tested with `dd of=/dev/full`, sending SIGUSR1 twice from another shell (to see the status immediately each time, without exiting), then hitting ^C (to see the status and then exiting), then restarting dd and hitting enter (to see a write error followed by the status before exiting). Bug: https://issuetracker.google.com/177017283
2021-02-03Cleanup pass on modprobe.Rob Landley
I need to set up a test environment for this...
2021-01-30Fix a couple of test regressions from last commit adding function() plumbing.Rob Landley
2021-01-28toysh: start of function call logic.Rob Landley
2021-01-28Shut gcc's "is not actually used uninitialized" false positive warnings up.Rob Landley
2021-01-26A few more getty cleanups.Rob Landley
2021-01-26getty/telnet/tftpd: minor cleanup.Elliott Hughes
Remove STDIN_FILENO and use FLAG(). Use xsetspeed() rather than have a duplicate table. Inline getty's print_prompt(). There's still a lot of cleanup needed here, in particular use of toybuf and removal of the inappropriately-named HOSTNAME_SIZE (and ideally sharing that logic with login(1) which already contains a better implementation of it).
2020-12-26toysh: fix break/continueRob Landley
2020-12-25toysh fixes and testsRob Landley
2020-12-19Fix (( )) quote termination.Rob Landley
2020-12-15Implement set, trace support, and function call context stack.Rob 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-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-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-11-27toysh: Adjust $0 for scripts.Rob Landley
2020-11-16Factor out do_source(), fpathopen(), and prompt_getline().Rob Landley
Use 0 optstr prefix, fix bug initializing toys.envc one too low.
2020-11-12readelf: harden against invalid input.Elliott Hughes
I also promised to fix readelf. Where in file(1) I made no attempt to say what was bad (or even to change `goto bad` to explicitly say that *anything* was bad), I believe that readelf is much more likely to be shown invalid ELF files, and that it would be useful to have some clue as to what's wrong. Relatedly, this patch removes all existing error_exit() calls in case it's being used on multiple files. Again, this survived ~24hrs of AFL++ trying to blow its house down. Test: ~/AFLplusplus/afl-fuzz -i tests/files/elf -o fuzz-out -- ./readelf -a @@
2020-10-23Fix endless recursion bug on nommu for sh -c 'echo $(echo)'Rob Landley
2020-10-21Promote watchdog.Rob Landley
2020-10-20Can't call daemon() on nommu.Rob Landley
2020-10-19More tests, and a workaround to pass one of them.Rob Landley
(The bug is that "echo hello \" followed by just enter should end the $PS2 state but it persists when the line is empty because resulting collated line still ends with \ so it wants another line.)
2020-10-19Implement source, fix empty ${x-alt}, use %zu as suggested by e5ten.Rob Landley
2020-10-15stty: don't mangle c_iflags.Elliott Hughes
Fixes https://github.com/landley/toybox/issues/251 where `stty 300` was mangling c_iflags to 0x300 because even if we don't match a full hex specification of struct termios, sscanf() will have overwritten the first value, which is c_iflag.
2020-10-15Patrick Oppenlander suggested watchdog also catch SIGINT.Rob Landley
2020-10-14Fix && || traversing loops, and typecast past size_t being stupidly typed.Rob Landley
2020-10-14Implement ${var/search/replace}Rob Landley
2020-10-13Fix up ${x%y} ${x^y} ${x,y} and add tests.Rob Landley
2020-10-11toysh: more variable/wildcard plumbing and tests.Rob Landley
2020-10-06toysh: Yank debug scaffolding.Rob Landley
2020-10-06toysh file wildcards: echo toys/*/*.c works now.Rob Landley
2020-10-04Implement ${x#y} and ${x##y}Rob Landley
Debug wildcard * match, teach skipslash() to fill out a wildcard deck, make collect_wildcards() flush remove the parsing-only 0th entry.
2020-10-02Cleanup pass on route.cRob Landley
2020-10-01Debug wildcard plumbing.Rob Landley
2020-09-27Implement wildcard match plumbing. (Not yet fully debugged.)Rob Landley
2020-09-23Only attempt to truncate regular files in dd.Rob Landley
2020-09-23Add ftruncate logic to handle non-regular filesChris Sarra
ftruncate was failing on device files, leading to whole dd.c failures. This patch allows us to dump device files.
2020-09-23Cleanup pass on stty.cRob Landley
2020-09-14Fix multiline case/esac parsing, make syntax_err() exit non-interactveRob Landley
contexts like scripts, and tweak debug scaffolding.
2020-09-10Add ipv6 support to wget.cChris Sarra
2020-09-05Fix segfault for sh -c 'echo {a..Z}'Rob Landley
Bash produces different output for that test, but I'm not sure I care? http://lists.landley.net/pipermail/toybox-landley.net/2020-September/011990.html The problem is parse_word() guarantees its output's quotes/escapes are completed, but brace expansion happens after parse_word() and thus violating assumptions later code depends on to not do redundant error checking. The easy fix is to escape punctuation produced by parse_word (which in bash can only happen when you span upper and lower case ranges so "\" is the only interesting character). I could special case this to match bash exactly, but I'm waiting for someone to complain instead.
2020-09-03Implement brace sequence expressions ala {a..z} and {1..37..2}Rob Landley
2020-09-02SIGHUP to init.c triggers inittab reloadChris Sarra via Toybox
2020-08-31Implement select.Rob Landley
2020-08-31Implement case/esac, add more wildcard tests.Rob Landley
2020-08-24Cleanup watchdog.c, as described on the list.Rob Landley
2020-08-24Introducing toys/pending/watchdog.cChris Sarra via Toybox
This patch introduces a simple watchdog implementation for toybox. We send the appropriate ioctls to set the relevant timeouts, and intercept signals to safely shut down if required.