Age | Commit message (Collapse) | Author |
|
|
|
|
|
|
|
The function loopback_setup(), after copying the loopback device name
with xstrncpy(), ensures the null-termination of the string by forcing
its last byte to 0.
Unfortunately, this operation:
- was probably intended to null-terminate dest instead;
- does not affect the program execution because src is free()d right
after;
- if the size of src is smaller than the offset of the written zero, it
modifies an unknown byte in the heap.
Drop the null-termination line to fix the issue: xstrcpy() automatically
null-terminates dest, or fails if the size of src is bigger than the the
requested number of bytes to copy.
Signed-off-by: Alessio Balsini <balsini@android.com>
|
|
|
|
|
|
|
|
Inline array becomes garbage outside the if.
|
|
The <netdb.h> functions have their own errno :-(
|
|
and silence "killed" messages from the shell by forking in a subshell.
|
|
These really should go in generated, but generated should be $GENERATED
and I need to find a way to set that so Makefile and scripts/make.sh can
use it from the same source. Right now cross.sh isn't sourcing .configure
and I don't really want to add it for this, so...
|
|
out clang's __has_include(), and && shorts out the eval for gcc.
|
|
The downside is we don't use assembly optimized libc comparison functions,
but the common case is short/no matches until full match. Probably net win.
|
|
Don't run the command with no arguments if we run out of input but
have already run the command at least once. The implementation of "run
the command at least once (unless -r was supplied)" wasn't taking into
account whether or not this was our first time round the loop.
Fix the exit value, and the -- already documented but not implemented --
behavior if a child exits with status 255.
Also extend the tests to cover these cases, plus cases I broke while
coming up with the fix. Add more tests to convince myself that we've
correctly interpreted how -s is supposed to behave, and fix the corner
cases at the bottom end of the range.
This fixes some issues we were seeing trying to build the Android SDK
for (and more importantly, on) macOS.
|
|
When user builds toybox CFG_TOYBOX_I18N disabled and tries to list
folder contents with multibyte characters other than UTF-8 ls might
seqfault since wcrtomb returns -1
while locale set to fi_FI-UTF-8 disable CFG_TOYBOX_I18N
touch őőőőaaőő
ls
|
|
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
|
|
and cleanup hostname to only call gethostname() once.
It passes the one test in test_hostname, if that helps.
|
|
|
|
|
|
|
|
|
|
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
|
|
We're inconsistent about whether the option help below should be just `-t`
or `-t DIR`, but the majority of commands _don't_ repeat their argument,
so I've left that as-is for now.
|
|
I must have lost this line somehow when I moved the patch from my AOSP
tree to a toybox tree. (But the ln tests passed on the host because I
was using coreutils ln there :-( )
|
|
|
|
|
|
|
|
|
|
|
|
Required by the new `ln -t` test if it's to pass on an all-toybox
system :-)
|
|
Just re-tar the extracted file and check we get the expected result.
|
|
|
|
|
|
|
|
|
|
Thanks for James McMechan for pointing this out.
Using esc[1L and esc[1M escapes with cursor jump to
1, 1 to make scrolling effect instead of S and T
fixes scrolling inside Linux terminal and tmux
-Jarno
|
|
|
|
|
|
Add mock gzip -n to satisfy pkgsrc.
|
|
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.
|
|
Investigate why downloads always freeze when I call ftpget. Trace it to
a refactor leaving two REST and zero RETR.
|
|
then pgrep finds child that hasn't exec("sleep") yet. So add 1/10 sec sleep
to let exec() happen before pgrep.
While we're there fix spurious "terminated" messages and reorder test file
creation so it fits in 80 columns.
|
|
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.
|
|
|
|
|
|
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.
|
|
|
|
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.)
|
|
|