Age | Commit message (Collapse) | Author |
|
|
|
POSIX chose I rather than i as the case-insensitive flag for s///,
because apparently more seds support I than i. We're allegedly alone in
only supporting i. (On the Mac, sed supports neither.)
Strictly this isn't *currently* in POSIX, but it's been accepted for
issue 8.
Bug: https://austingroupbugs.net/view.php?id=779#c2050
|
|
|
|
|
|
Used by the Linux kernel build when copying kernel headers to
kernel-headers.tar.gz.
Bug: http://b/152244851
|
|
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.
|
|
to functions that aren't entry points, and collate debug code at top.
|
|
|
|
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.
|
|
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.)
|
|
|
|
|
|
|
|
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).
|
|
|
|
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.
|
|
My desktop and laptop have a pid_max of 262144 now.
|
|
(It was outputting the patch hunk where it went, which reverted the context.)
|
|
|
|
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.
|
|
Going to $ made draw_page render cursor to wrong line
|
|
|
|
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.)
|
|
Even GNU don't pretend they're still on 1970s terminals where ` and '
were a matching pair any more.
|
|
Rewrite -v and -p to not use ad hoc argument parsing.
|
|
|
|
|
|
|
|
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
|
|
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).
|
|
Found by GCC 9:
toys/lsb/mount.c:188:22: warning: '%s' directive argument is null [-Wformat-overflow=]
|
|
|
|
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).
|
|
(A git build takes it from "git describe".)
|
|
|
|
makes those two remaining tests pass.
|