aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2020-02-26More sh tests.Rob Landley
2020-02-26Fix bugs reported by anatasluo: min/range/max were out of order,Rob Landley
min/max weren't being calculated, only print summary when we recieved at least one reply packet. And switch to FLAG() macros.
2020-02-26Fix xclearenv() breakage pointed out by Derrick Pallas.Rob Landley
Toybox doesn't modify inherited environ[] (the same way we don't modify our inherited argv[]), so instead of freeing our allocated environ[] when we want to clear it we need to allocate a new environ[] in the else path (at a length compatible with the existing plumbing's add stride), set the first entry of _that_ to 0, and set toys.envc = 1 to record it's an alloced environ.
2020-02-25Shell ! testsRob Landley
2020-02-25Fix off by one error that treats bit 31 as negative (so ls --color setsRob Landley
all the bits). While we're at it, make LL be ULL so bit 63 doesn't have the same problem.
2020-02-25ps: widen pid_t fields.Elliott Hughes
My desktop and laptop have a pid_max of 262144 now.
2020-02-24Fix fuzz to output lines that didn't match patch context.Rob Landley
(It was outputting the patch hunk where it went, which reverted the context.)
2020-02-22Make ASAN=1 affect the HOSTCC-built tools too.Elliott Hughes
Bug: https://github.com/landley/toybox/issues/169
2020-02-22mkflags: fix a sscanf buffer off-by-one.Elliott Hughes
Sadly, the compilers don't even catch this common mistake if you use sscanf_s(3). Luckily, ASan does.
2020-02-20Fix bitrot in macos_miniconfig.Elliott Hughes
2020-02-17More sh tests.Rob Landley
2020-02-17Rename config symbol now that we've worked around the worst of the breakage.Rob Landley
2020-02-17Work around kernel build bug where "make distclean" doesn't work in cp -sfRRob Landley
directory. Downside: this modifies (distcleans) the source directory for an out of tree build, but the alternative is (sometimes subtle) build breaks.
2020-02-17Tighten up build script a little.Rob Landley
2020-02-17For "cross.sh all" announce each target in title bar.Rob Landley
2020-02-17Fix musl-cross-make nommu build (at least for sh2eb).Rob Landley
2020-02-14Tests for upcoming sh plumbing.Rob Landley
2020-02-11Fix wget version concat segfault.Denys Nykula
2020-02-11chattr: fix exit status, redo the tests.Elliott Hughes
The e2fsprogs chattr(1) returns failure when it fails to do what was asked of it, and so should we. Fixing this then reveals a lot of issues with the tests that were being accidentally swept under the carpet. The bulk of this patch is going through all the tests, removing the duplicates and making the remaining tests more thorough. I've tested this on ext4 and f2fs on a variety of 4.x and 5.x kernel versions (but nothing older). We might need to reduce the list of attribtues we try to toggle, but the more thorough tests use well-supported attributes. I've also fixed the -R test to actually involve a directory hierarchy.
2020-02-10Factor out readfd()Rob Landley
2020-02-06vi: fix pointer pos when at end of lineJarno Mäkipää
Going to $ made draw_page render cursor to wrong line
2020-02-06Basic parenthetical subshell support.Rob Landley
2020-02-06chattr: improve error messages.Elliott Hughes
When chattr fails in production, it helps to see what it was trying to do. Reuse the lsattr format but without the '-'s. Only read the flags if we have any intention of changing them: `chattr -p 123` has no reason to read the flags. Only write the flags back if they actually change: `chattr +a` shouldn't do anything if that flag is already set, for example. Switch -p and -v to perror_msg() instead of perror_exit() in case they're used with -R. (I suspect that the uses of DIRTREE_ABORT are mistakes given -R, but I'll leave them until I actually hit this.)
2020-02-06Remove old GNU style `' quoting.Elliott Hughes
Even GNU don't pretend they're still on 1970s terminals where ` and ' were a matching pair any more.
2020-02-06Don't recurse into multiplexer more than once.Rob Landley
Fixes make sh && ./sh -c 'toybox ls'
2020-02-05chattr: reuse toybox argument parsing.Elliott Hughes
Rewrite -v and -p to not use ad hoc argument parsing.
2020-02-05Fiddle with main() comments.Rob Landley
2020-02-04More (subshell) work (not finished), fix {block;} | pipes.Rob Landley
2020-02-03readelf: support large ELF64 files on LP32 systems.Elliott Hughes
2020-02-03vi: fix 32-bit build.Elliott Hughes
2020-02-02vi: Replace linelist with Piece table based designJarno Mäkipää
Replaced dlist linelist with continuous memory blocks. This will allow editing huge files without billion mallocs. File is first opened with mmap() and mapped region is fully described in block_list as one block. Currently "valid" data is described as slices, when first loading file there is only one slice that points to memory existing in block_list. When cutting text, block_list is not freed or modified, but instead slice_list is modified to have "hole" between 2 slices. when inserting new mem_block is added, previos slices are cut in cursor position and new slice is added... Added functions to handling data inside block_list+slice_list insert_str(), cut_str() are used for all delete and add operations text_strrchr(), text_strchr() are used for searching lineendings text_byte(), text_codepoint(), text_getline() are for simple data access Implemented: more or less all previous functionality Implemented more proper file write: file is saved to .swp, blocks are unloaded, file permissions are copied, and atomic rename is called, block is reloaded chmod some defaults(rw-rw-r--) if original file could not be fstat (does not exist) FIX make all tests pass Removed: Some unused functions
2020-02-02vi: fix dw_last test, add more testsJarno Mäkipää
Fixed delete last word test. (script should not have \n since it is cursor down in vim) Added tests to check inserts Added tests to check yank and push
2020-02-02Canonicalize the usage: lines for the POSIX toys.Elliott Hughes
This only touches 24 of the 68 toys/posix/ files --- the others were already canonical. Potentially contentious, so worth stating explicitly, is that there were 8 matches for "COMMAND..." amongst all existing help output, with 7 matches for various inconsistent variants involving something with "ARG", so I resolved that in favor of using "COMMAND..." (which is also shorter overall, and avoids nested []s).
2020-02-02mount.c: fix an error check.Elliott Hughes
Found by GCC 9: toys/lsb/mount.c:188:22: warning: '%s' directive argument is null [-Wformat-overflow=]
2020-02-01Now that both sed instances are using -E, we don't need to call it twice.Rob Landley
2020-02-01chattr.test/lsattr.test: fix on more kernels/fses.Elliott Hughes
The tests now pass on all the systems available to me (cloud Android with encrypted f2fs, current AOSP with regular f2fs, and current Debian testing with ext4).
2020-02-01Auto-initialize variables, some of which are readonly and some exported.Rob Landley
2020-02-01Collate sed calls and remove trailing spaces.Rob Landley
2020-02-01lsattr/chattr: improve help text.Elliott Hughes
Document all the attributes, and take less space doing so. Switch to CAPITALS for user input in the synopses. Don't imply that this is only for ext2 (but also don't try to list the subset of file systems that do support which subset of attributes).
2020-01-31chattr.test: fix tests.Elliott Hughes
Cope with all the extra flags added recently, and ignore random stuff from the environment like extents and encryption. Tested on a cloud Android emulator with f2fs.
2020-01-31Call sed twice instead of five times.Rob Landley
2020-01-31lsattr.test: clean up and fix.Elliott Hughes
My previous attempt to fix this worked for ext-with-extents on the desktop, but not for f2fs-with-encryption on cloud Android devices. This feels quite a bit cleaner, and has the benefit of actually working everywhere I've tried it. I've also added perfunctory testing of -p too, which was missing before.
2020-01-30Move TOYBOX_VERSION fallback definition to toys.h.Rob Landley
(A git build takes it from "git describe".)
2020-01-30Couple more tests and sh comment changes. (Mostly todo list tracking.)Rob Landley
2020-01-30gcc 8.3 requires different config to build the same toolchain, because gcc.Rob Landley
2020-01-30More sh tests.Rob Landley
2020-01-29Quick and dirty "echo $ABC" support, done totally the wrong way, but itRob Landley
makes those two remaining tests pass.
2020-01-28David Legault complained that dir/.* tells rm to delete dir/.. and we'd do it.Rob Landley
2020-01-28lsattr: fix tests.Elliott Hughes
I'm trying to switch Android over to toybox chattr/lsattr from e2fsprogs. Remove those tests that relied on being able to use chattr(1), remove the duplication that tested both a bare name and a full path, take into account all the flags that lsattr can now output, and cope with the fact that the exact flags you'll see depend on your file system. (Unfortunately this means trusting lsattr in the lsattr tests, which isn't ideal, but without a known environment I don't think we can do any better.)
2020-01-26Add mayfork to printfRob Landley