Age | Commit message (Collapse) | Author |
|
|
|
This patch does two things:
1. Enable line buffering for echo and yes. I found this through test
flakiness from the toybox xargs tests running in CI on devices where
"echo" is provided by toybox. For `echo y`, GNU echo does one write
of "y\n" but toybox echo was doing two writes, which makes it more
likely (4% on the heavily-loaded CI machines) for writes from the two
processes to be interleaved.
2. Fix line buffering on glibc if you're calling `toybox foo` rather
than `foo`. Otherwise we come through once and switch to unbuffered
mode, then again and switch to line buffered mode --- which doesn't
seem to actually work in glibc unless you specify a buffer (so
passing toybuf and sizeof(toybuf) works, but NULL and 0 doesn't).
I hit the second issue trying to reproduce the first issue on the desktop
rather than on Android.
(If you're scratching your head wondering "why yes(1) too, not just
echo(1)?", that represents a blind alley I went down when I mistook
which tool was in use. It seemed like the same principle should apply,
and it matches what other implementations do.)
|
|
|
|
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...
|
|
Unfortunately neither "C.UTF-8" nor "UTF-8" works on *both* OSes...
|
|
|
|
configurable.
|
|
|
|
|
|
This can still be pretty ragged because it just leaves space for the
longest name at the end of each line rather than measuring the name that
actually comes next, but at least with this change we never over-run.
I noticed this because ConnectBot on my current device gives me a
60-column terminal.
busybox seems to do this, though it seems to actually measure, judging
by how close it gets to the margin. That doesn't seem worth the effort
though?
|
|
the first google hit for "android toybox"), and want toybox --help to
mention it. I was referred to https://github.com/landley/toybox/issues/50
So add a URL to toybox --help. While I was there, make unrecognized commands
(like toybox -?) suggest "toybox --help", move the install instructions
to the FAQ page (with a second link from toybox --help), and generally
tighten up the help text. Also, "toybox -*" is no longer a synonym for --long.
Oh, and I fixed some build dependencies when Config.in changes.
|
|
adding symlink indirection support put the basename() in the wrong place.
|
|
|
|
|
|
Fixes make sh && ./sh -c 'toybox ls'
|
|
|
|
(A git build takes it from "git describe".)
|
|
builtin, and add -u.
|
|
|
|
We still prefer C.UTF-8 for predictability, but macOS doesn't have that.
|
|
|
|
|
|
|
|
(Commit 7771e94e2a08 broke it.)
|
|
|
|
Commands that want something different can override this, but it seems like
a fairly minor optimization and write(1) exists if we want to micromanage...
|
|
|
|
|
|
Both positive and both negative should work, even crossing midpoint (which
should never happen on linux) works in two's complement.
|
|
is reserved for the kernel), but technically a pointer is unsigned long.
|
|
"ln -s gsed sed" or similar if you need to use nonstandard names for things.
|
|
|
|
|
|
(only enable character parsing, force utf8, "C" semantics otherwise.)
|
|
|
|
|
|
Signed-off-by: Joyounger <aquanox@163.com>
|
|
|
|
|
|
|
|
|
|
because lookup failure left this->which NULL and error_exit() dereferenced it.
(Oops.)
|
|
Say "toybox" before version string. Tweak sed to preserve lie-to-autoconf.
|
|
apply it to "true" and "false".
|
|
In main.c: used adjusted string with placeholers for removed options (so flag
values don't move based on config, allowing FORCE_FLAGS to work).
In scripts/mkflags.c: test was wrong, a bare longopt never matches a single
letter command, but it was treated as always matching when comparing
allyesconfig vs current config to determine which options were disabled, so
there was a corner case that got the flag values wrong.
|
|
The latest tagged version is 0.7.1.
|
|
<strike>all that tedious mucking about with hyperspace</strike>
stack measuring in ways that confuse security stuff.
|
|
undefined behavior so the optimizer can silently eliminate your entire program.
|
|
|
|
When toybox is installed suid root and invoked by a non-root user for
commands which do not require root privileges, it drops the root
privileges during initialization.
However, since commit afba5b8efd the result check of setuid() was
inverted such that it aborted on success, making toybox unusuable for
non-root users.
Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
|