Age | Commit message (Collapse) | Author |
|
|
|
|
|
|
|
|
|
Cached $IFS value has to be per function context because local vars.
|
|
|
|
|
|
Remove cached blk/pout/urd and make TT.ff->blk always be populated instead
(like TT.ff, list is never empty), have current pipe (and block trailing)
redirections live in current TT.ff->blk.
Left in a bunch of commented debug printfs and a filehandle dump function.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Noticed while using telnetd to manually test some telnet fixes: telnetd
would sometimes exit when I'd disconnect because it couldn't find pid 0
on its list of sessions.
I've not seen obscure exits because select() times out, but I've also
changed that `return` to an error_exit() so we'll at least know what's
happened if that ever occurs.
Also use <arpa/telnet.h> rather than manually #define'ing its constants,
use the FLAG() macro throughout, and xsetsockopt(). Don't pointlessly
set errno to 0 at the start of main and then never look at it again.
|
|
The kill(2) should be checking whether `pid` still exists, not the
process that wait(2) just told us has exited.
|
|
(fixes up some test suite tests).
|
|
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().
|
|
Not fully wired up yet, probably a bunch of regressions.
|
|
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
|
|
I need to set up a test environment for this...
|
|
|
|
|
|
|
|
|
|
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).
|
|
|
|
|
|
|
|
|
|
|
|
http://lists.landley.net/pipermail/toybox-landley.net/2020-December/012169.html
|
|
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).
|
|
Add new toy `pwgen`.
A usefule password generation utility.
|
|
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
|
|
|
|
Use 0 optstr prefix, fix bug initializing toys.envc one too low.
|
|
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 @@
|
|
|
|
|
|
|
|
(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.)
|
|
|
|
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.
|
|
|
|
|
|
|
|
|
|
|