Age | Commit message (Collapse) | Author |
|
xwaitpid(), fix off by one in xwaitpid().
|
|
The "gratuitous extra entry" is only gratuitous when there isn't a hole. (Which
we can detect and not include but then we wouldn't match other implementations.)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(oops.)
|
|
|
|
length of sparse files properly.
|
|
|
|
There's nothing to stop a subprocess from catching our SIGTERM on timeout
and exiting, causing us to incorrectly report that it didn't time out.
Android's ART has a utility that does exactly this.
Explicitly catch this case, and add corresponding tests.
Bug: http://b/141007616
|
|
|
|
(All ignored, because they disable stuff we don't do.)
|
|
|
|
Two more spacing bugs here, one before the security context for -Z, and
one after the size with --full-time.
Before:
$ ./toybox ls -lZ --full-time Config.
-rw-r----- 1 enh primarygroup? 56162019-09-07 21:09:32.892215100 -0700 Config.in
After:
$ ./toybox ls -lZ --full-time Config.
-rw-r----- 1 enh primarygroup ? 5616 2019-09-07 21:09:32.892215100 -0700 Config.in
|
|
Add: tabs, follows tabstop variable currently hardcoded to 8. Should be adjustable with :set tabstop N according to man page
fix: search, issue with searching substring that is more left than
cursor position on following lines.
|
|
|
|
DNS responses were limited to 512 bytes back when they were UDP only,
but if you have a TCP connection you can get up to 64KiB.
Also use the existing constant for the size of rrname.
Also update the help text.
Also consistently use `sizeof(T)` rather than `sizeof T`.
Also use consistently use `ARRAY_LEN`.
Fixes #56.
Test: `toybox host value.testing.express`
|
|
I really needed to be able to edit a file on the device, and this was
the nearest thing handy, and it turns out to be more or less usable for
basic editing, so...
Support cursor keys.
Support :q (since there's currently no record of whether the file's
modified or not, :q is the same as :q!).
Add 'A' to insert at end of line.
Add 'n' to find next after '/'.
Fix backspace all the way to get out of ex command mode.
Fix escape sequences to not hard-code assumptions about the terminal's
default background and foreground colors.
Fix 'spesial' typo for 'special', and remove explicit array sizes.
|
|
If you accidentally configure the sha-3 sums on, but don't enable
libcrypto, you'll get toys that just output md5 sums instead. This patch
doesn't cause a build-time error (my original plan), but does at least
ensure that toybox refuses to include incorrect sha-3 sum
implementations.
|
|
|
|
|
|
subdir name now anyway, and making toybox isn't in a subdir.
|
|
|
|
|
|
|
|
produce different output names for different ${TARGET}s.
|
|
Update source links, add a bit more rationale.
|
|
does CLOEXEC (should fix macos build).
|
|
I think when I wrote this I tested the named escapes like \n and hex
escapes, and when I found \x wasn't supported I didn't even think of
octal. And I only learned about \c when I was looking at echo and printf
to compare their escape implementations a few weeks back.
Add the missing escapes and corresponding tests.
Fixes #139.
|
|
|
|
This broke a netd test (but sadly in postsubmit rather than presubmit).
Also add a trivial test that would at least have caught this bug.
Bug: http://b/140453237
|
|
|
|
targets using https://github.com/richfelker/musl-cross-make
|
|
|
|
This lets me see the _meaningful_ differences between toybox and
e2fsprogs, which is probably good for the health of both.
I've tried to get the whitespace fixed upstream a few times since 2017,
but...
(The current differences are that e2fsprogs doesn't support f2fs labels,
and outputs reiserfs labels after the uuid rather than before.)
On the util-linux front, although my patch earlier this month fixed the
tests against util-linux 2.32, I now have 2.33 on my laptop, and that's
added a new LABEL_FATBOOT field :-/
|
|
Commit c26870dab3462c6176936384b090df6b9ba46dee broke ls' error
reporting for files that don't exist. `ls $F` is used by some as an
equivalent of `test -e $F`.
This patch also adds a regression test.
|
|
This fixes the case where someone's done something (weird) like:
find src/*.c -name foo.c
Previously the match would fail because one side of the comparison was
already a path.
|
|
as unusual timestamp formats
After further research and testing, I've produced a patch which handles
all filenames with special characters by copying the GNU quoting
behavior, and also treats anything following a tab as a timestamp. This
increases both ability to handle possible filenames and ability to
apply patches found in the field.
In diff, quote and escape filenames according to the following rules.
* Surround the filename with quotes if it contains a byte less than 0x20,
a byte greater than or equal to 0x80, space, backslash, or quote.
* Replace alert, backspace, form feed, newline, carriage return, tab, vertical
tab, backslash, and quote with \a, \b, \f, \n, \r, \t, \v, \\, and \",
respectively.
* Replace other bytes less than 0x20 or greater than or equal to 0x80 with a
backslash followed by the three octal digits representing the value of the
byte.
* Treat valid UTF-8 characters involving sequences of bytes greater than or
equal to 0x80 the same as other sequences of such bytes.
In patch, process quoted and escaped filenames according to the following
rules.
* If the filename does not begin with a quote, do not modify the filename.
* Remove quotes surrounding the filename.
* In quoted filenames, replace \a, \b, \f, \n, \r, \t, \v, \\, and \" with
alert, backspace, form feed, newline, carriage return, tab, vertical tab,
backslash, and quote, respectively.
* In quoted filenames, replace a backslash followed by octal digits with the
byte with that value in octal.
Also, in patch, treat anything on a +++ or --- line following a tab character
after the beginning of the filename as a timestamp, rather than part of the
filename.
|
|
if true; then if false; then echo one; elif echo two; then echo three; else echo four; fi; fi
|
|
Unlike ls, find does treat ENOENT specially. Add an extra test (and fix
the behavior) for the case of ENOENT for a path provided on the command
line --- unlike other ENOENT cases (typically dangling symlinks), ENOENT
for a command line argument should report an error.
Also remove obsolete `|sed` from the symlink loop test.
|
|
I put it in configure, with the other environment variables, instead of
in scripts/make.sh. Here's Elliott's original commit comment:
==========
Just use `ASAN=1 make test_grep` or whatever.
You'll probably want to set $ASAN_SYMBOLIZER_PATH to point to
llvm-symbolizer, but Debian makes that annoying by calling the
symbolizer /usr/bin/llvm-symbolizer-4.0 or whatever, and ASan refuses to
use it:
==43370==ERROR: External symbolizer path is set to
'/usr/bin/llvm-symbolizer-4.0' which isn't a known symbolizer. Please
set the path to the llvm-symbolizer binary or other known tool.
My usual workaround for this is to drop an llvm-symbolizer symlink in
the current directory, and I'm happy to automate that in the script to
make it require no knowledge of any of this nonsense, but haven't done
so in this initial patch.
I tested that this is actually working by reverting the grep fix and
running `ASAN=1 make test_grep`.
|
|
The Linux kernel uses the --max-args synonym for -n.
Barbarians who use vi need xargs' -o to be able to do something like:
find -name xargs.c | xargs vi # Sad vi.
find -name xargs.c | xargs -o vi # Happy vi.
The -p option needs fixing to read from /dev/tty because stdin is
otherwise occupied in xargs. I think xargs is the only place that needs
this, so it didn't seem sensible to make all callers to yesno() be
specific about which they wanted, hence the new function.
Also remove the documentation for the build-time XARGS_PEDANTIC option
which isn't actually implemented.
Also add a TODO for -P (which is used by at least one script in the
Linux kernel).
|
|
Tweak DIRTREE_STATLESS so it returns zero stat for any error (I'm testing
that dev, ino, and blksize are all zero), and fill in file type from readdir()
|
|
The "info" pages are something very different from the "intro" pages :-)
do_lines already closes the fd.
Also improve the error message for `man`.
|
|
macOS remains awkward, though, but this retains our Android/Linux
behavior and is closer to the platform's getconf(1) for macOS.
Strictly macOS denies all knowledge of UIO_MAXIOV, but the "undefined"
you'll get from this patch seems closer than the "1024" we used to
give.
|
|
Before:
$ ./rm
rm: Needs 1 argument
$ ./rmdir
rmdir: Needs 1 argument (see "rmdir --help")
After:
$ ./rm
rm: Needs 1 argument (see "rm --help")
|