Age | Commit message (Collapse) | Author |
|
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).
|
|
|
|
Turns out I move around using these a lot too. I do tend to have very
tall terminals...
|
|
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.
|
|
|
|
|
|
|
|
|
|
In case I'm not yet in the running for the most pedantic change of this
release, I think the "days of the week are written with initial capitals
in English" subset of this patch is a strong contender.
(Found via `toybox help -a | ispell -l | sort | uniq`.)
|
|
Looks like I left off half way through this!
Also default readelf to n while it's still in pending.
|
|
We were incorrectly passing a pointer to a pointer of an
unsigned long long, when we just wanted to pass a pointer
to the unsigned long long. This is especially bad on 32-bit
systems, where we're then writing a 64-bits into a 32-bit value
within ioctl.
We fix this to pass a pointer to the unsigned long long.
Test: On 32-bit device, no longer see native crash from toybox
Bug: http://b/151311535
Signed-off-by: Elliott Hughes <enh@google.com>
|
|
to functions that aren't entry points, and collate debug code at top.
|
|
|
|
The shift was a remnant from when BLKGETSIZE (which measures in
blocks) was being used on Linux. The Mac has two separate ioctls
for block count and block size, which we're already multiplying
together. And on Linux we're using BLKGETSIZE64, which returns a
result in bytes, not blocks. So lose the shift.
|
|
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.
|
|
The recent re-enablement of the BLKGETSIZE64 code broke the Mac
build. Use the equivalent <sys/disk.h> ioctl() pair instead.
|
|
I came here because the new -Wno-unreachable-code-loop-increment warning
didn't like the for loop on line 86. That loop is indeed not necessary.
Use strend() to do a string suffix match.
Use memmem() to search. It's available on macOS and Android by default,
but it's behind _GNU_SOURCE for glibc, so add that to portability.h.
Output the tags in the same order as the Debian modinfo.
I've left "parmtype" in even though the Debian modinfo doesn't output it
at all.
Also fix the tests so that they work on a device that has modules for
multiple kernels installed (like my laptop) --- make sure that the two
modules we pick come from the same kernel.
|
|
Not entirely debugged, but more or less there-ish.
|
|
add: test for -D
fix: b/c/d/FILE not copying into a/ with -D option
dirname() is not needed when handling FLAG(D) since filename under
src or dest should not be changed.
github.com/landley/toybox/issues/165
|
|
|
|
|
|
The question "how does this toybox command behave" should have an answer,
not "it depends". (Also, --preserve at the start of a paragraph was confusing
config2help.c into thinking it was an option paragraph.)
|
|
|
|
|
|
It builds binutils first, so ld being there doesn't mean cc finished.
|
|
|
|
|
|
|
|
|
|
|
|
(Update to the 64 bit API while we're there. And yes, I checked in the
kernel, it's 512 byte units.)
|
|
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).
|
|
|
|
These didn't work on a system where readlink is a symlink to toybox,
ironically.
|
|
|
|
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
|
|
|
|
Also fix another bug where we were testing `set` twice.
Fixes https://github.com/landley/toybox/issues/172.
|
|
|
|
min/max weren't being calculated, only print summary when we recieved
at least one reply packet. And switch to FLAG() macros.
|
|
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.
|
|
|
|
all the bits).
While we're at it, make LL be ULL so bit 63 doesn't have the same problem.
|
|
My desktop and laptop have a pid_max of 262144 now.
|
|
(It was outputting the patch hunk where it went, which reverted the context.)
|
|
Bug: https://github.com/landley/toybox/issues/169
|
|
Sadly, the compilers don't even catch this common mistake if you use
sscanf_s(3). Luckily, ASan does.
|
|
|
|
|
|
|