aboutsummaryrefslogtreecommitdiff
path: root/toys/pending
AgeCommit message (Collapse)Author
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
2019-12-29Implement single command env assignments (abc=def command) and make debugRob Landley
output #definable.
2019-12-29Debug basic pipe support and I/O flush for builtins.Rob Landley
2019-12-28Next round of sh plumbing: more work on redirect and pipe, use CLOEXEC.Rob Landley
2019-12-23Toysh passes two tests now! Woo! (Otherwise, does not remotely work right now.)Rob Landley
2019-12-15Nothing in pending should default y.Rob Landley
2019-12-12Next round of toysh work, with associated lib plumbing.Rob Landley
2019-12-04Fix getopt optstringE5ten
Move longopts after their corresponding shortopts instead of before
2019-11-24bc: fix a comparison bugGavin Howard
2019-11-22Add getopt(1).Elliott Hughes
Includes new tests.
2019-11-03ip: remove get_line().Elliott Hughes
2019-10-21vi: unalloc used memory, cleanups, fixesJarno Mäkipää
add: linelist unload fix: proper utf8 handling on insert mode backspace fix: free allocated data at exit cleanup: rename some variables to be describive but short cleanup: reorganize some variables in main
2019-10-19wget: Added support for HTTP 301 and 302 redirectsJarno Mäkipää
Added: parsing of redirectation responses, will now follow redirectation path until maximum of 10 jumps. This will probably lead to server advertising user the https url.
2019-10-09vi: fixesJarno Mäkipää
fix: force redraw after :set (no)list fix: force redraw after insert fix: split on zero cursor position fix: yank and push with utf-8 content
2019-10-04vi: Scroll unmodified lines using escape codesJarno Mäkipää
Scroll visual buffer up and down using standard escapes when content has not changed, instead of redrawing every keypress. Sidescroll now moves all the lines instead of only cursor one. Side scrolling long lines unfortunately causes redraw to whole screen. -Jarno
2019-09-23Call ftpget from wgetDenys Nykula
Branch wget to xexec ftpget given an ftp url. Rename the output flag -O like in other wgets. Add mock wget --no-check-certificate to satisfy pkgsrc. Ifdef the version output in wget because the nonexistent constant fails single builds and mkroot.
2019-09-22vi: Added yankJarno Mäkipää
Added: yank and push Rewrote: delete operations Minor cleanups: Rewrote delete operations to use one delete function instead of having separate behavior here and there. Now delete and yank both always move cursor and then clip the whole cursor area into yank register. For example x is just ld or jd depeding are we right edge or not, and dd is jd with some special flags etc. Now only default yank register is implemented, but implemeting yank register list should be trivial since cmd execution already passes register char.
2019-09-19vi: changes to buffer drawingJarno Mäkipää
Replaced: draw_str_until with lib/crunch_str() where possible Removed: Unused char draw functions. Implemented: crunch_nstr() which is crunch_str with additional check for byte length, this can be used to draw substrings or non null terminated strings. (This can be moved to lib/ if its useful for others) Reimplemented: Buffer drawing without line wrapping. Now too long lines are drawn with @ in end. And cursor line scrolls left and right when hitting right margin point. This will simplify buffer handling alot. Linewrapping can be reimplemented later if needed but will add complexity Implemented: set list and set nolist ex commands, set list will show escape codes such as tabs Fix: Bug on splitting 2 lines, split was 1 byte off.
2019-09-09vi: added support for tabsJarno Mäkipää
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.
2019-09-08make "for i in" work.Rob Landley
2019-09-07host: cope with large DNS responses.Elliott Hughes
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`
2019-09-07vi: small fixes.Elliott Hughes
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.
2019-08-29diff and patch: support special characters in filenames with quoting as well ↵William Haddon
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.
2019-08-29Fix sh handling nested if/else/elif statements alaRob Landley
if true; then if false; then echo one; elif echo two; then echo three; else echo four; fi; fi
2019-08-23man: fix help, align -k output, and fix double close.Elliott Hughes
The "info" pages are something very different from the "intro" pages :-) do_lines already closes the fd. Also improve the error message for `man`.
2019-08-18Next round of shell plumbing.Rob Landley
You can now run: echo hello; if true; then echo hello; fi; while true; do echo hello; done It's got the start of for loops but needs environment variable resolver to do much with them.
2019-08-15dd: fix skip= with short reads.Elliott Hughes
Subtract the amount we actually read, not what we asked for.
2019-08-09lsof: simplify octal mode display.Elliott Hughes
Since this masks, it doesn't actually have the same bug as e5942a8c90c2f52550496fdf08efddb564d8e5a3, but we may as well fix the other example of that questionable idiom while we're thinking about it...
2019-08-09Split out run_function() and free_function(), add start of _TOYSH_LOCALSRob Landley
marshalling for vforked subshells, fix rc returned from run_pipeline for variable assignment. (Well, sort of: X=$(false) still needs rc = 1.)
2019-08-04Make "if true; then echo hello; fi" work. More work on redirection.Rob Landley
2019-08-02Next round of infrastructure. Start of redirect logic and runtime flow control.Rob Landley
2019-07-31man: switch to xregcomp.Elliott Hughes
All regcomp callers are now going through xregcomp.