aboutsummaryrefslogtreecommitdiff
path: root/toys/pending
AgeCommit message (Collapse)Author
2020-04-06Pass more tests, and detect ELF files (don't try to run them as shell scripts).Rob Landley
Don't fall back to stdin if we can't find shell script on command line.
2020-04-04Fix lifetime rules in bracket expansion.Rob Landley
2020-04-02Move #include <linux/*.h> into individual commands, initialize structRob Landley
with memset() instead of = {}, and move TT.alarm to local variable.
2020-04-02Fix macOS build.Elliott Hughes
I'd put the rtc_wkalarm struct in the globals to get it zeroed for free, but since there's no such type on macOS, that breaks the build. Rather than define a bogus struct in portability.h, I've gone for making it an explicitly-zeroed local. (And I've sorted the locals largest-first.) Note that the use of struct rtc_time as if it was the same as struct tm in this code follows the existing code in hwclock, but I worry that we're going to have trouble with that because of the extra tm_gmtoff and tm_zone fields in struct tm. But that's a worry for another day... This patch also removes the CONFIG_CP_PRESERVE from the macos_miniconfig, since that option was removed a while back.
2020-04-02More shell plumbing. Redo of variable storage, add export.Rob Landley
2020-04-01Add rtcwake.Elliott Hughes
Some of the bringup folks are debugging RTC issues and asked for this. Rather than duplicate the weird xtzset dance with mktime, I've factored that out into a new xmktime that takes a boolean for whether to use UTC or local time. Otherwise, the slight cleanup of hwclock.c is entirely optional. The only functional change there is that util-linux 2.34's hwclock uses ISO time format, which is the usual toybox preference anyway, so I've switched it over to that rather than ctime(3). Bug: http://b/152042947
2020-03-18Next round of shell work.Rob Landley
Rethink syntax_err a bit. Try to track top level shell pid for $$ including passing it to nommu subshells. Reset hfd more often so it doesn't climb endlessly. Leak fewer filehandles and detect more filehandle exhaustion errors. Replace skip_quote() with a second mode for parse_word(). Fix $() and implement $(<input).
2020-03-16vi: implement H/M/L.Elliott Hughes
Turns out I move around using these a lot too. I do tend to have very tall terminals...
2020-03-16vi: semi-functional ^E/^U and ^F/^B.Elliott Hughes
The forward movement seems okay (no worse than the equivalent arrow key movement), but I haven't yet worked out how to move the cursor back when necessary. Also fix the location of the cursor in ex mode, and stop showing ex commands in bold.
2020-03-13Pass a few more test suite entries.Rob Landley
2020-03-13Fix "eval x=y", add exec, only prompt if stdin is a tty, search $PATH for scriptRob Landley
2020-03-13readelf: fix interpreter name length check.Elliott Hughes
Looks like I left off half way through this! Also default readelf to n while it's still in pending.
2020-03-12Shuffle code around: eliminate one of two function prototypes, add "static"Rob Landley
to functions that aren't entry points, and collate debug code at top.
2020-03-11Redo NOFORK plumbing so commands like eval/unset can access/edit shell state.Rob Landley
2020-03-11vi: don't keep fd open unnecessarily.Elliott Hughes
As soon as mmap() is done, we can close the fd. xmmap() also will exit rather than return failure so we can remove that check, and fdlength() will fall back to lseek() so there's no need to have the fallback in vi itself. Spotted because the `TT.fd = 0` in linelist_unload() seemed suspicious; -1 would have been more natural.
2020-03-09Next round of shell plumbing: variable expansion with $IFS.Rob Landley
Not entirely debugged, but more or less there-ish.
2020-03-05Fix 'for i in one two three; do echo =$i=; done'Rob Landley
2020-03-01readelf: various fixes.Elliott Hughes
Add -e, and stop documenting no-op -W. Fix sign issues, and add a few extra sanity checks. Redo the BE/LE 16/32/64 reading. Remove the NOSPACE=1 from the -l test, and fix the -l code to match the binutils output. Most usefully, this fixes the weird way the NULL section's empty name would cause misalignment in the section to segment mapping output. Add a test for -s (symbol table).
2020-03-01Snapshot of variable resolution implementation. Not remotely load bearing yet.Rob Landley
2020-02-28vi: Rearrange functions, add o, O, IJarno Mäkipää
Place function calls in order so that there is no unneeded declarations, clear some whitespace stuff. Add few commands that are commonly used. cleanup: reorganize functions cleanup: some whitespace stuff add: vi_o vi_O vi_I fix: stop at edges when h and l fix: fix dd not updating screen fix: render after all delete moves
2020-02-11Fix wget version concat segfault.Denys Nykula
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-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-01Auto-initialize variables, some of which are readonly and some exported.Rob Landley
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-29Quick and dirty "echo $ABC" support, done totally the wrong way, but itRob Landley
makes those two remaining tests pass.
2020-01-26Implement nommu subshell plumbing, <(command), and fix 2>&1Rob Landley
2020-01-25vi: Add testsJarno Mäkipää
Test file integrity after load, move, delete and save+exit. Drawing of buffer is not tested yet. Added -s script option, accept file that is run as startup script of commands. File is parsed byte at time and handled as you had typed it. If EOF has been reached without editor close command, editing is continued normally using keyboard. This functionality is in vim and neovim, but not in POSIX vi standard. nvi (vi used in some macs) has -s with different meaning... Some simple tests added, dw last line test fails, so test is disabled.
2020-01-15vi: fixes and small cleanupJarno Mäkipää
fix: first line delete fix: delete with e move fix: statusline 1 row lower, remove eol cleanup: use dlist_pop on delete cleanup: move globals into GLOBALS
2020-01-14vi: don't exit on ^C or ^D.Elliott Hughes
^D is the opposite of ^U in vi (the ^D/^U pair is the half-screen version of ^F/^B). ^C is unbound in vi. It's pretty surprising for these to cause toybox vi to exit, and it's annoying as long as toybox vi unconditionally exits rather than checks whether there are unsaved modifications! (I'm tempted to implement ^D/^U and ^F/^B, but I don't want to make Jarno's rebase of his in-progress changes any harder.)
2020-01-11Fix a duplicate free() and a variable stomp, set s=s to fix "can never beRob Landley
used uninitalized" warning, move flow control character detection to the right place, change scratch zeroing to the same way main() does it.
2020-01-11sh.c: fix memory corruption due to uninitialized sh_function in sh_runRich Felker
2020-01-10readelf.c: fix 32-bit.Elliott Hughes
All of this was fine on LP64 where `long` and `long long` are the same length, but breaks the LP32 build with -Wformat.
2020-01-09readelf: RELR (both new and historical).Elliott Hughes
The "historical" variant is still the only one in use on Android right now. We still need to switch to the numbers we agreed on with the other System V ABI users. See https://groups.google.com/g/generic-abi/c/bX460iggiKg for the original discussion on RELR.
2020-01-09vi: fix warnings, improve status display.Elliott Hughes
mbtowc(0, 0, 4) is weird, and ignoring the result is weird. Avoid all this by just reusing the toybox lib utf8 functions. Also fix the row/column display on the status line to count from 1 and correctly distinguish bytes and characters in non-ASCII, and change the mode output to only explicitly say when we're in insert mode, in the same way that vim does. (Every time I saw the old blue-on-black text for COMMAND I thought toybox vi had crashed!)
2020-01-08Implement readelf(1).Elliott Hughes
Basic readelf(1) implementation, with output close enough to the binutils version to be usable with scripts that expect the binutils version. This started as an implementation of nm(1) until I realized that I almost always want readelf instead, and that you actually have to do much of the work needed for readelf just to implement nm. Arguably nm (being part of POSIX) belongs in toybox while readelf doesn't. An argument could also be made that neither really belongs in toybox, belonging in a separate set of development tools (such as binutils or the LLVM binutils). Doesn't support most of the architecture-specific stuff, most notably relocations, but is aware of things like ARM exidx sections and the common register state notes in core dumps for the "big four" architectures: arm, arm64, x86, and x86-64. Doesn't support symbol versions (but probably should). Doesn't support section groups or the -t "section details" (which is a long form of -S "section headers" that I've never seen used in practice and which isn't part of -a). Doesn't support dumping unwind info or the hash table bucket histograms. Reuses the table of ELF architectures from file(1). Not fuzzed, but successfully parses all the ELF files in my Ubuntu 18.04 system's lib directories. Attempts to exit with an error when presented with an invalid ELF file rather than struggle on as binutils seems to.
2020-01-08Remove lots of debugging dprintf()s.Rob Landley
2020-01-08Fix commaless brace discard.Rob Landley
2020-01-08Implement quote removal and fix unterminated bracket expansion.Rob Landley
2020-01-07Bracket support in progress. Mind the dprintf()s.Rob Landley
2020-01-03Add local variables support.Rob Landley
2020-01-03Finish cd, make help -ahu unconditional, fix expand memory cleanup path,Rob Landley
set $HOME $PWD and $OLDPWD, fix prompt \w, shuffle some functions around to avoid prototypes, implement tilde expansion, add FORCE_COPY.
2020-01-01Factor out array_add(), replace argxtend().Rob Landley
2020-01-01If allocation update is done in blocks, initial allocation has to populateRob Landley
a full block.
2019-12-31toysh: start of <(echo hello) support.Rob Landley