OSDN Git Service

android-x86/external-toybox.git
6 years agoFix the pidof comm and cmdline tests.
Elliott Hughes [Fri, 9 Feb 2018 06:41:52 +0000 (22:41 -0800)]
Fix the pidof comm and cmdline tests.

If we have a 15-byte name, we don't know whether comm actually matches
or is a truncated form of a longer name that has a common prefix.

For example, with "this-is-a-very-long-name-that-is-too-long", we shouldn't
match "this-is-a-very-" (but the old code would).

The cmdline code was also broken on Android because it used basename(3)
rather than getbasename. This doesn't affect glibc because there's a
workaround in portability.h to ensure that we get the non-POSIX basename(3)
with glibc but then a non-glibc section that ensures everyone else gets
POSIX basename(3). That should probably be removed (and maybe `basename`
poisoned) to prevent similar mistakes in future.

Bug: http://b/73123244

6 years agoAndreas Gampe suggested a different fix.
Rob Landley [Fri, 9 Feb 2018 15:03:34 +0000 (09:03 -0600)]
Andreas Gampe suggested a different fix.

(Bionic _does_ do the malloc(0)!=0 thing, the problem is pedantic access
checking, not null dereference. So test count instead.)

6 years agoThinko pointed out by Andreas Gampe (causing segfaults in top, oops).
Rob Landley [Thu, 8 Feb 2018 14:57:10 +0000 (08:57 -0600)]
Thinko pointed out by Andreas Gampe (causing segfaults in top, oops).

6 years agoPeople keep running ./configure, so have it do a defconfig for them.
Rob Landley [Mon, 5 Feb 2018 02:07:12 +0000 (20:07 -0600)]
People keep running ./configure, so have it do a defconfig for them.

6 years agoAdd crc32.
Rob Landley [Sun, 4 Feb 2018 23:35:29 +0000 (17:35 -0600)]
Add crc32.

In cksum, make -H pad with leading zeroes to 8 chars, don't output len with -N,
and don't output filename with zero arguments.

6 years agoAhem, I _said_ basic ping support.
Rob Landley [Thu, 1 Feb 2018 01:55:13 +0000 (19:55 -0600)]
Ahem, I _said_ basic ping support.

6 years agoBasic ping support.
Rob Landley [Wed, 31 Jan 2018 00:44:58 +0000 (18:44 -0600)]
Basic ping support.
Requires echo 0 $((1<<30)) > /proc/sys/net/ipv4/ping_group_range (as root)

6 years agoRevert the ps -T thing until I understand what Elliott wants.
Rob Landley [Wed, 24 Jan 2018 21:10:44 +0000 (15:10 -0600)]
Revert the ps -T thing until I understand what Elliott wants.

6 years agoFix hang in losetup test.
Elliott Hughes [Mon, 22 Jan 2018 22:04:24 +0000 (14:04 -0800)]
Fix hang in losetup test.

Switch the printf over to %s because the input is actually hex (so %d
is wrong), but without the leading "0x" that %x would require.

For some reason the NODE assignment wasn't providing any input to awk
(hence the hang), and awk wasn't looking for the correct field anyway.

The tests still fail for me:

  losetup: /dev/block/loop0: No such device or address
  losetup: /dev/block/loop0: No such device or address
  losetup: file: No such file or directory
  losetup: needs 1 arg (see "losetup --help")

But at least now they allow the other tests to continue!

6 years agoFix variables in help.txt
Reverend Homer [Sun, 21 Jan 2018 20:45:02 +0000 (23:45 +0300)]
Fix variables in help.txt

6 years agogzip cleanup: fix test_gzip, unify do_gzip/do_gunzip, inline gzerror_msg().
Rob Landley [Sun, 21 Jan 2018 16:55:07 +0000 (10:55 -0600)]
gzip cleanup: fix test_gzip, unify do_gzip/do_gunzip, inline gzerror_msg().

6 years agoFix gunzip to past test_gunzip.
Rob Landley [Sun, 21 Jan 2018 04:29:25 +0000 (22:29 -0600)]
Fix gunzip to past test_gunzip.

6 years agoFix "ps -T 1234" to show thread belonging to that PID.
Rob Landley [Tue, 16 Jan 2018 03:46:45 +0000 (21:46 -0600)]
Fix "ps -T 1234" to show thread belonging to that PID.

6 years agoMerge shared_main() back into ps_main() and top_main(), add comments.
Rob Landley [Mon, 15 Jan 2018 19:37:25 +0000 (13:37 -0600)]
Merge shared_main() back into ps_main() and top_main(), add comments.

6 years agoAdd more comments to ps.
Rob Landley [Mon, 15 Jan 2018 17:51:42 +0000 (11:51 -0600)]
Add more comments to ps.

6 years agoSwitch xgettty() -> tty_fd() (returning -1 instead of erroring out if none).
Rob Landley [Mon, 15 Jan 2018 05:15:01 +0000 (23:15 -0600)]
Switch xgettty() -> tty_fd() (returning -1 instead of erroring out if none).

6 years agoMove make help text out of Makefile.
Rob Landley [Wed, 10 Jan 2018 16:54:11 +0000 (10:54 -0600)]
Move make help text out of Makefile.

6 years agoAdd the gzip/gunzip/zcat tests I wrote for toolbox gzip/gunzip/zcat.
Elliott Hughes [Mon, 24 Apr 2017 20:29:30 +0000 (13:29 -0700)]
Add the gzip/gunzip/zcat tests I wrote for toolbox gzip/gunzip/zcat.

Bringing the zlib-based gzip/gunzip/zcat over to toybox is a problem for
another day, but at least the tests are easy...

(These tests pass with TEST_HOST and on the toolbox versions, but the
toybox toys are in pending and very broken.)

6 years agoMove millitime() into lib.c.
Rob Landley [Sat, 6 Jan 2018 21:43:17 +0000 (15:43 -0600)]
Move millitime() into lib.c.

6 years agoCleanup pass on gzip.c.
Rob Landley [Wed, 3 Jan 2018 18:53:46 +0000 (12:53 -0600)]
Cleanup pass on gzip.c.

6 years agoPromote logger, and fluff up help text a bit.
Rob Landley [Mon, 1 Jan 2018 22:32:13 +0000 (16:32 -0600)]
Promote logger, and fluff up help text a bit.

6 years agoCleanup logger.c, and move the facilitynames/prioritynames SYSLOG_NAMES
Rob Landley [Mon, 1 Jan 2018 22:25:18 +0000 (16:25 -0600)]
Cleanup logger.c, and move the facilitynames/prioritynames SYSLOG_NAMES
stuff syslog.h does into lib.c and portability.h

6 years agoxphung on github said: "config2help currently doesn't work on OS X, it
Rob Landley [Mon, 1 Jan 2018 17:24:48 +0000 (11:24 -0600)]
xphung on github said: "config2help currently doesn't work on OS X, it
terminates parsing of Config.in at first blank line. This is because
getdelim() in portability.c returns -1 whenever the line comprises only
a single linefeed character. Fixing this was a trivial change to two lines
(see below), and config2help now works on OS X but I haven't regression
tested this on any other commands which rely on getdelim()"

6 years agoPromote iconv.
Rob Landley [Fri, 29 Dec 2017 23:19:02 +0000 (17:19 -0600)]
Promote iconv.

6 years agoCleanup iconv.
Rob Landley [Fri, 29 Dec 2017 22:43:38 +0000 (16:43 -0600)]
Cleanup iconv.

Implement -c, fix endless loop when illegal char happens with
!outleft (don't need to check errno, just in == toybuf), refill
buffer each time (less efficient handling of illegal chars but never
have to worry about how long constitutes a valid sequence in unknown
encoding).

Fix input longer than 2k (memmove() has src/dest switched, second time through
loop in starts at offset inleft...) Made it start at beginning every time.

Switch iconv_open() error msg to show to/from and errno (rather than
hardwired english text).

6 years agoPromote setfattr
Rob Landley [Wed, 27 Dec 2017 17:23:43 +0000 (11:23 -0600)]
Promote setfattr

6 years agoMinor cleanup on setfattr.c
Rob Landley [Wed, 27 Dec 2017 17:21:21 +0000 (11:21 -0600)]
Minor cleanup on setfattr.c

6 years agoAdd xxd -i (and xxd -ri).
Elliott Hughes [Sun, 24 Dec 2017 08:42:38 +0000 (00:42 -0800)]
Add xxd -i (and xxd -ri).

The original xxd doesn't support -r with -i. The original also outputs
"unsigned char name[] = { ... };" for input other than stdin, but that
actually makes it less useful --- many languages support array
initializers, but far fewer support that exact declaration syntax.

Also fix the -c range checking and defaulting: ><= in the argument string
only works for floating point arguments.

Bug: http://b/64711851

6 years agoFix xargs -0 with -n.
Elliott Hughes [Tue, 26 Dec 2017 05:24:57 +0000 (21:24 -0800)]
Fix xargs -0 with -n.

Also make -0 and -E mutually exclusive (rather than just ignore -E
with -0).

Bug: https://github.com/landley/toybox/issues/78

6 years agoAdd fmt.
Elliott Hughes [Sun, 24 Dec 2017 07:44:04 +0000 (23:44 -0800)]
Add fmt.

A very simple implementation of fmt, good enough for my daily use of !!fmt
in vi to reflow checkin comments like this.

6 years agoRedo namestopid to handle more cases.
Rob Landley [Fri, 22 Dec 2017 20:56:37 +0000 (14:56 -0600)]
Redo namestopid to handle more cases.

6 years agoFix make bloatcheck dependencies (pointed out by Patrick Oppenlander).
Rob Landley [Tue, 19 Dec 2017 22:16:31 +0000 (16:16 -0600)]
Fix make bloatcheck dependencies (pointed out by Patrick Oppenlander).

6 years agokillall should kill scripts too.
Elliott Hughes [Wed, 13 Dec 2017 19:47:08 +0000 (11:47 -0800)]
killall should kill scripts too.

Found running LTP file system tests on Android.

Bug: http://b/70627145

6 years agoAn incomplete list of deviations from posix (it's a start).
Rob Landley [Mon, 11 Dec 2017 13:19:37 +0000 (07:19 -0600)]
An incomplete list of deviations from posix (it's a start).

6 years agoCleanup pass on stty: collate do_stty() calls for future inlining,
Rob Landley [Sun, 10 Dec 2017 20:12:19 +0000 (14:12 -0600)]
Cleanup pass on stty: collate do_stty() calls for future inlining,
collapse flag arrays to fewer lines, factor out xtcgetattr(),
strip curly brackets around single lines, don't have a separate error
message for tcsetattr() return code if more thorough check is on next line,
take advantage of O_RDONLY being zero, document -F.

6 years agoUse NULL rather than 0 in vargs.
Elliott Hughes [Mon, 4 Dec 2017 20:31:53 +0000 (12:31 -0800)]
Use NULL rather than 0 in vargs.

Top bits count too!

6 years agoCommands in pending should default n.
Rob Landley [Sun, 3 Dec 2017 07:30:39 +0000 (01:30 -0600)]
Commands in pending should default n.

6 years agoAdd stty(1).
Elliott Hughes [Sat, 2 Dec 2017 06:43:38 +0000 (22:43 -0800)]
Add stty(1).

Full POSIX stty with Linux extensions. Output and behavior match coreutils
8.26 as far as I can tell. For some reason busybox 1.22 stty always
shows all the special characters, even when they match "sane". I've
matched coreutils, since "shows differences from sane" is easy to describe
and obviously useful.

Flags in the various arrays are not in the order they're introduced in
POSIX or in the Linux header file: they're in the order that they're
output by coreutils' stty.

The -g output matches coreutils and busybox.

I implemented iuclc, xcase, and olcuc even though they've been removed
from POSIX because the others implement them, and "man stty" defines "raw"
and "sane" in terms of them (where POSIX doesn't define "sane" in any
useful sense).

This builds fine against glibc 2.24, and as far as I can tell all the
constants used were in Linux 2.6 so I'm assuming that there shouldn't
be any #ifdef nonsense needed for any reasonable vintage of C library.

6 years agoDon't capitalize in the middle of a sentence.
Elliott Hughes [Fri, 17 Nov 2017 00:16:12 +0000 (16:16 -0800)]
Don't capitalize in the middle of a sentence.

Before:
  toy: Unknown option p (See "toy --help")

After:
  toy: Unknown option p (see "toy --help")

6 years agoAdd uptime -p.
Elliott Hughes [Fri, 17 Nov 2017 00:35:10 +0000 (16:35 -0800)]
Add uptime -p.

We (Android) give up trying to teach folks what "up 142 days,  1:45"
means...

Bug: http://b/65205261

6 years agoGaël PORTAY wants mdev to work when Linux has the block layer configured out.
Rob Landley [Sun, 3 Dec 2017 07:20:42 +0000 (01:20 -0600)]
Gaël PORTAY wants mdev to work when Linux has the block layer configured out.

6 years agoAndroid has its loop devices under "block" as Elliott says "by reason of
Rob Landley [Sun, 3 Dec 2017 03:18:52 +0000 (21:18 -0600)]
Android has its loop devices under "block" as Elliott says "by reason of
historical accident", so fall back to check there.

Also remove an obsolete comment TODO block, check !parent for dirtree
top of tree instead of '/' in the filename, and typecast some printf
arguments for 32-bit systems.

6 years agoRecognize sh/frv fdpic, and add types for bpf and new microblaze.
Rob Landley [Mon, 27 Nov 2017 05:40:20 +0000 (23:40 -0600)]
Recognize sh/frv fdpic, and add types for bpf and new microblaze.

6 years agoUse endianness info to read executable type.
Rob Landley [Sun, 26 Nov 2017 11:33:35 +0000 (05:33 -0600)]
Use endianness info to read executable type.

6 years agoAdd "time -v".
Elliott Hughes [Fri, 17 Nov 2017 20:10:36 +0000 (12:10 -0800)]
Add "time -v".

This shows the other fields in getrusage. I've chosen to only show the
ones actually maintained by Linux.

6 years agoMake find -exec + obey ARG_MAX just like xargs.
Elliott Hughes [Thu, 16 Nov 2017 21:59:37 +0000 (13:59 -0800)]
Make find -exec + obey ARG_MAX just like xargs.

This isn't ideal, but it matches xargs and none of us is likely to have
time to do the best possible thing any time soon.

Bug: http://b/65818597
Test: ./toybox find /usr/local/google/ndkports/ -exec echo {} +

6 years agoMinor tweaks.
Rob Landley [Fri, 17 Nov 2017 03:04:31 +0000 (21:04 -0600)]
Minor tweaks.

6 years agoAdd "df -i".
Elliott Hughes [Wed, 15 Nov 2017 21:06:17 +0000 (13:06 -0800)]
Add "df -i".

Also switch to u64 for calculations. Some FUSE file systems have inode
counts large enough to overflow s64.

6 years agofile(1): add ogg, TrueType font, LLVM bitcode, PEM certs, and PE executables.
Elliott Hughes [Wed, 1 Nov 2017 18:09:42 +0000 (11:09 -0700)]
file(1): add ogg, TrueType font, LLVM bitcode, PEM certs, and PE executables.

More of the files encountered on the Android system image (plus PE
executables, which we build but which shouldn't actually make it to the
system image!).

6 years agoAdd top -m, fix width truncating for narrow screens (off by one), and add iotop -H
Rob Landley [Wed, 1 Nov 2017 00:44:32 +0000 (19:44 -0500)]
Add top -m, fix width truncating for narrow screens (off by one), and add iotop -H

6 years agoRename test_*.c to demo_*.c (because "make test_$CMD" means something already),
Rob Landley [Tue, 31 Oct 2017 20:51:02 +0000 (15:51 -0500)]
Rename test_*.c to demo_*.c (because "make test_$CMD" means something already),
fluff out README, and add a comment to hostid explaining its deprecation.

6 years agoOnly show LABEL= when there is one.
Rob Landley [Tue, 31 Oct 2017 20:43:38 +0000 (15:43 -0500)]
Only show LABEL= when there is one.

6 years agoFix cut -s and -f when delimiter not found (posix says print whole line).
Rob Landley [Tue, 31 Oct 2017 20:30:04 +0000 (15:30 -0500)]
Fix cut -s and -f when delimiter not found (posix says print whole line).

6 years agoWeb page updates.
Rob Landley [Sat, 28 Oct 2017 08:26:33 +0000 (03:26 -0500)]
Web page updates.

6 years agoMake -c work with unicode chars, and first stab at -C measuring columns.
Rob Landley [Thu, 26 Oct 2017 01:27:33 +0000 (20:27 -0500)]
Make -c work with unicode chars, and first stab at -C measuring columns.

6 years agoInsmod dummy for ifconfig tests, and "pointopoint" only has two t's.
Rob Landley [Sun, 22 Oct 2017 18:36:02 +0000 (13:36 -0500)]
Insmod dummy for ifconfig tests, and "pointopoint" only has two t's.

6 years agoAdd stat to index.
Rob Landley [Sun, 22 Oct 2017 16:52:32 +0000 (11:52 -0500)]
Add stat to index.

6 years agoI ended up writing a new find from scratch, so remove old unfinished cleanup log.
Rob Landley [Sun, 22 Oct 2017 16:42:59 +0000 (11:42 -0500)]
I ended up writing a new find from scratch, so remove old unfinished cleanup log.

6 years agoTypo.
Rob Landley [Sun, 22 Oct 2017 16:41:27 +0000 (11:41 -0500)]
Typo.

6 years agoUse char for exitval and wasroot (first capped at 8 bits and second's a flag).
Rob Landley [Sat, 21 Oct 2017 14:53:14 +0000 (09:53 -0500)]
Use char for exitval and wasroot (first capped at 8 bits and second's a flag).

6 years agoUse setlocale(LC_CTYPE, "C.UTF-8") for more targeted locale enable:
Rob Landley [Sat, 21 Oct 2017 14:48:24 +0000 (09:48 -0500)]
Use setlocale(LC_CTYPE, "C.UTF-8") for more targeted locale enable:
(only enable character parsing, force utf8, "C" semantics otherwise.)

6 years agoElliott wants to add TOYBOX_VENDOR.
Rob Landley [Thu, 19 Oct 2017 21:49:52 +0000 (16:49 -0500)]
Elliott wants to add TOYBOX_VENDOR.

6 years agoFix groups(1) and id -G.
Elliott Hughes [Fri, 29 Sep 2017 22:20:26 +0000 (15:20 -0700)]
Fix groups(1) and id -G.

Both should only output the groups.

6 years agoAllow ro. properties to have arbitrary lengths
Tom Cherry [Thu, 12 Oct 2017 16:43:32 +0000 (09:43 -0700)]
Allow ro. properties to have arbitrary lengths

Android now allows ro. properties to have arbitrary lengths.  Two
changes need to happen to support this:

1) The length check in setprop.c before attempting to set a property
   needs to be removed for ro. properties
2) __system_property_read_callback() must be used in place of
   __system_property_get() in getprop.c as only the former is capable
   of reading properties with size > 92 characters.

Bug: 23102347
Bug: 34954705
Change-Id: Ib8565a3e6d987dd5e6a5fe790e804ecf8ad1e020

6 years agoTweak help_exit() to show "See %s --help" message on the same line.
Rob Landley [Tue, 10 Oct 2017 23:16:08 +0000 (18:16 -0500)]
Tweak help_exit() to show "See %s --help" message on the same line.

6 years agoComplete rewrite of cut. Handle multipe ranges, add -DFO options, start
Rob Landley [Tue, 10 Oct 2017 16:24:11 +0000 (11:24 -0500)]
Complete rewrite of cut. Handle multipe ranges, add -DFO options, start
of utf8 support (not finished yet)...

Adds new loopfiles_lines() wrapper to lib.c that calls do_lines from loopfiles.

6 years agoWorkaround from Patrick Oppenlander for a bug in config2help.h that resulted
Rob Landley [Tue, 3 Oct 2017 08:29:38 +0000 (03:29 -0500)]
Workaround from Patrick Oppenlander for a bug in config2help.h that resulted
in segfaults on newer toolchains. (That entire section is due for a rewrite.)

6 years agoFix xargs to obey POSIX's ARG_MAX restrictions.
Elliott Hughes [Wed, 20 Sep 2017 20:53:23 +0000 (13:53 -0700)]
Fix xargs to obey POSIX's ARG_MAX restrictions.

This avoids "xargs: exec echo: Argument list too long" errors in practice.

find(1) needs to be fixed too, but that's a bit more complicated and a working
xargs provides a workaround.

Bug: http://b/65818597
Test: find /proc | strace -f -e execve ./toybox xargs echo > /dev/null

6 years agoBasic Mach-O support in file(1).
Elliott Hughes [Mon, 25 Sep 2017 16:59:48 +0000 (09:59 -0700)]
Basic Mach-O support in file(1).

The Nexus Player build was subtly broken in that it assumed that the host was
using ELF. No-one noticed until a Mac user tried to flash their build, which
contained a Mach-O x86 binary instead of an ELF x86 binary. Hilarity ensued.

(On the same day, file(1) was able to explain a mixup with an ELF hexagon
binary. Next time we see a Mach-O binary on an Android device, we'll be ready!)

Bug: http://b/66741960

6 years agoAdd #warning about musl intentionally breaking chrt.
Rob Landley [Thu, 21 Sep 2017 20:33:01 +0000 (15:33 -0500)]
Add #warning about musl intentionally breaking chrt.

6 years agoFix URL typo
Zach Riggle [Wed, 13 Sep 2017 17:15:45 +0000 (12:15 -0500)]
Fix URL typo

6 years agoLast commit used xstrtod(), forgot to check it in.
Rob Landley [Sun, 10 Sep 2017 03:05:10 +0000 (22:05 -0500)]
Last commit used xstrtod(), forgot to check it in.

6 years agoRedo/add seq precision logic.
Rob Landley [Sun, 10 Sep 2017 02:35:19 +0000 (21:35 -0500)]
Redo/add seq precision logic.

Josh Gao hit a case where "seq 1000000 1000001" output 1e+06, and while he
was there changed several things to work like existing seq implementations.
I changed a couple back (commenting out the test cases) until somebody
came come up with a reason (or existing use case) to do it that way.

6 years agoTighten up wc -m tests (which no longer depend on $LANG).
Rob Landley [Wed, 6 Sep 2017 11:12:09 +0000 (06:12 -0500)]
Tighten up wc -m tests (which no longer depend on $LANG).

6 years agoReplace remaining mb*towc() calls with utf8towc().
Rob Landley [Wed, 6 Sep 2017 02:04:43 +0000 (21:04 -0500)]
Replace remaining mb*towc() calls with utf8towc().

6 years agoTweak utf8towc() to return -1 earlier sometimes (instead of -2), and add test
Rob Landley [Tue, 5 Sep 2017 07:36:24 +0000 (02:36 -0500)]
Tweak utf8towc() to return -1 earlier sometimes (instead of -2), and add test
program to compare against libc output.

6 years agoutf8towc() has to be in lib.c if strlower() is going to use it, because
Rob Landley [Sun, 3 Sep 2017 01:40:24 +0000 (20:40 -0500)]
utf8towc() has to be in lib.c if strlower() is going to use it, because
scripts/*.c builds against lib.c but not linestack.c.

6 years agoIn wc, replace mbrtowc() with new utf8towc() which doesn't have a context struct
Rob Landley [Sat, 2 Sep 2017 23:15:09 +0000 (18:15 -0500)]
In wc, replace mbrtowc() with new utf8towc() which doesn't have a context struct
or care about locale.

6 years agoAnother try at fixing the ps segfault resulting from /proc entries vanishing
Rob Landley [Thu, 31 Aug 2017 21:50:27 +0000 (16:50 -0500)]
Another try at fixing the ps segfault resulting from /proc entries vanishing
out from under us due to asyncronous process exit.

The directory we're traversing vanishing can result in DIRTREE_ABORTVAL
being returned, which we turn into a NUL entry, but then we were trying to
look at that null entry's children. Oops.

6 years agoFix iconv build and add trivial test.
Elliott Hughes [Tue, 22 Aug 2017 21:03:45 +0000 (14:03 -0700)]
Fix iconv build and add trivial test.

6 years agolsof cleanup.
Rob Landley [Fri, 18 Aug 2017 02:50:27 +0000 (21:50 -0500)]
lsof cleanup.

6 years agoCheck for .git before setting GITHASH.
Rob Landley [Mon, 7 Aug 2017 01:42:34 +0000 (20:42 -0500)]
Check for .git before setting GITHASH.

The GITHASH problem was building a tarball version under an existing git repo,
where git describe found ../../../../.git so only call git if we have a .git
directory in the source.

6 years agoAllow GITHASH to be set on the command line, to work around a yocto bug.
Rob Landley [Sun, 6 Aug 2017 01:12:57 +0000 (20:12 -0500)]
Allow GITHASH to be set on the command line, to work around a yocto bug.

6 years agoDon't unnecessarily use printf in wc.test when echo will do.
Elliott Hughes [Fri, 4 Aug 2017 00:13:20 +0000 (17:13 -0700)]
Don't unnecessarily use printf in wc.test when echo will do.

(And is much faster if your shell doesn't have a builtin printf.)

6 years agoTest that our rm -rf can zap chmod 000 directories. (Skip test on host
Rob Landley [Tue, 25 Jul 2017 20:13:16 +0000 (15:13 -0500)]
Test that our rm -rf can zap chmod 000 directories. (Skip test on host
because ubuntu's can't.)

6 years agoAdd basic env.test
Rob Landley [Sun, 23 Jul 2017 19:32:27 +0000 (14:32 -0500)]
Add basic env.test

6 years agotestcmd should only use absolute path to command when not doing TEST_HOST.
Rob Landley [Sat, 22 Jul 2017 22:00:11 +0000 (17:00 -0500)]
testcmd should only use absolute path to command when not doing TEST_HOST.

6 years agoTypo (env -0 was checking the flag wrong).
Rob Landley [Sat, 22 Jul 2017 21:44:00 +0000 (16:44 -0500)]
Typo (env -0 was checking the flag wrong).

6 years agonetcat: make -l exit after handling a request.
Josh Gao [Fri, 9 Jun 2017 17:51:18 +0000 (10:51 -0700)]
netcat: make -l exit after handling a request.

Bug: http://b/62305466

6 years agotypo
Rob Landley [Mon, 17 Jul 2017 10:37:05 +0000 (05:37 -0500)]
typo

6 years agoRedo ping plumbing. Actual ping part isn't there yet because kernel weirdness.
Rob Landley [Mon, 17 Jul 2017 10:24:34 +0000 (05:24 -0500)]
Redo ping plumbing. Actual ping part isn't there yet because kernel weirdness.

6 years agoSplit out xgetaddrinfo() from xconnect()
Rob Landley [Mon, 17 Jul 2017 10:23:45 +0000 (05:23 -0500)]
Split out xgetaddrinfo() from xconnect()

6 years agoDon't remove "remount" from the option list during early parsing, the mount
Rob Landley [Tue, 11 Jul 2017 10:17:35 +0000 (05:17 -0500)]
Don't remove "remount" from the option list during early parsing, the mount
flag doesn't get set right otherwise and it tries to overmount instead.

6 years agocomma_scan()'s clean option wasn't removing entry at end of list.
Rob Landley [Tue, 11 Jul 2017 10:16:09 +0000 (05:16 -0500)]
comma_scan()'s clean option wasn't removing entry at end of list.

6 years agodd cleanup: binary search is overkill, eliminate struct pair,
Rob Landley [Sun, 9 Jul 2017 07:13:00 +0000 (02:13 -0500)]
dd cleanup: binary search is overkill, eliminate struct pair,
simplify strstarteq, use local variable "conv" instead of toys.optargs.

6 years agoFix -Wformat compiler warning in expr.c.
Elliott Hughes [Fri, 7 Jul 2017 20:06:36 +0000 (13:06 -0700)]
Fix -Wformat compiler warning in expr.c.

Android forces -Wformat on for all source.

  toys/pending/expr.c:116:28: warning: field precision should have type 'int',
                                       but argument has type 'long' [-Wformat]
      ret->s = xmprintf("%.*s", m[1].rm_eo-m[1].rm_so, target+m[1].rm_so);
                         ~~^~   ~~~~~~~~~~~~~~~~~~~~~

6 years agoPosix says strings should only output hits that end with NUL or newline.
Rob Landley [Fri, 7 Jul 2017 21:36:45 +0000 (16:36 -0500)]
Posix says strings should only output hits that end with NUL or newline.
We don't currently do that, but a test suite checking that we don't
do that is requiring us to violate posix to pass it.

6 years agostrings -t oxd tests
Ilya Kuzmich [Mon, 29 May 2017 14:57:09 +0000 (17:57 +0300)]
strings -t oxd tests

6 years agoMake dd use atolx_range(), and teach atolx_range() about "w" suffix (word, *2).
Rob Landley [Fri, 7 Jul 2017 08:51:47 +0000 (03:51 -0500)]
Make dd use atolx_range(), and teach atolx_range() about "w" suffix (word, *2).

6 years agoFix dd tests so TEST_HOST passes. (Ubuntu's dd doesn't support hex values
Rob Landley [Fri, 7 Jul 2017 08:43:24 +0000 (03:43 -0500)]
Fix dd tests so TEST_HOST passes. (Ubuntu's dd doesn't support hex values
and don't expect a specific error message, just that it errored.)