Age | Commit message (Collapse) | Author |
|
|
|
|
|
Or any call to comma_scan where 'opt' appears as the last item in 'optlist'.
|
|
|
|
to greppable TODO annotations in the individual files. (grep -riw TODO)
|
|
Doing a world writeable mkdir and _then_ adding a label seems like a race
window, so set the global "create stuff with these labels" context, then
do the creates.
|
|
make lib/lsm.h auto-include from toys.h.
|
|
portability.h to new lib/lsm.h. Update ls.c to use it.
Fix "ls . toys" (two directories when one is . or ..), which was filtering
out the . as something we shouldn't recurse into even though it was explicitly
listed on the command line. For some reason "ls -Z . toys" is still segfaulting
though (but "ls -Z ." isn't), need to figure out why...
|
|
terminal reset escape sequence) and add gettty() function to lib so terminal
gets reset even when we redirect stdout/stderr. (This is apparently the
expected behavior.)
|
|
under traversal. Pass through full flag set in dirtree_add_node(), add
dirtree_start() wrapper to provide symlink-only behavior (avoiding a lot
of DIRTREE_SYMFOLLOW*!!(logic) repeated in callers).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
alphasort), add compile-time probe for config symbol TOYBOX_ON_ANDROID.
|
|
|
|
The shell's pseudo-variable is called LINES. This is true of at least
bash and mksh.
|
|
|
|
|
|
(137 returned "137 KB".)
|
|
|
|
|
|
|
|
|
|
signal handling.
|
|
TOYBOX_DEBUG enabled.
One again gcc manages to be incompetent about producing warnings. For example,
in bzcat we error_exit() with a message that's an error code fed into an
array of string constants, and apparently dereferencing an array of string
literals doesn't give you a string literal according to -Wformat-security.
Not breaking the code to humor the compiler here, the compiler is wrong.
|
|
i'll be AFK for a week, so here's the patch i've been using this
evening to find other format string mistakes. BSD uses __printflike
and takes two arguments instead of hard-coding (1,2), but i figured
that as long as you don't need the generality you'd prefer not to have
it. and it's easy enough to retrofit if we ever do have a formatting
function that takes other arguments.
|
|
|
|
Inline open_wall_clock_rtc() into rtc_open(), factor out xtzset(),
inline set_sysclock_from_hwclock(), set_hwclock_from_sysclock(),
and set_sysclock_timezone().
/etc/adjtime is short enough we don't need to bother with a break.
The final "else" case in main() should always trigger because >0 in optstr
says "at most zero arguments", so the || at the end is always true, so
take the test off.
|
|
|
|
faccessat(AT_SYMLINK_NOFOLLOW) is not supported.
|
|
|
|
a static inline in portability.h, and prototype dirname() while we're at it.
|
|
I considered a #else on the big #ifdef __GLIBC__ above, but that
seemed harder to follow.
|
|
|
|
|
|
|
|
the SELinux commands (such as chcon) and the SELinux-specific options
to regular commands (such as ls -Z).
This lets us #include <selinux/selinux.h> in portability.h.
I've also fixed chcon to insist on being given the a context argument.
This patch also adds -Z to id and fixes id's regular output (-G should
be separated by spaces, non-G output should be separated by commas,
and you don't want a double comma where the egid is omitted from the
list of groups).
|
|
|
|
add estrtol() (which clears errno first), and xstrtol() (which error_exit()s on overflow).
|
|
|
|
macros for a disabled command (needed when multiple commands share infrastructure with a common set of flags).
This means the flag space is no longer packed, but leaves gaps where the zeroes
go. (Actual flag bit positions are the same for all configs.) Since the
option parsing needs to know where the holes are, the OPTSTR values are
now generated as part of flags.h with ascii 1 values for the disabled values.
(So generated/oldflags.h went away.)
This also means that the option string argument for OLDTOY() went away, it now
uses the same arguments as the NEWTOY() it references.
|
|
random other symbol name (because gnu) and this screws up nontrivial macro expansions of NEWTOY(basename), so work around it in portability.h.
|
|
|
|
|
|
The tizen guys wanted this. Yeah, I know there's base64 code in
uuencode/uudecode, but that this has -i, input lines aren't of fixed length,
encode/decode are in same file, there's no prefix/suffix code, it always
writes to stdout... Eliminating the code duplication wouldn't be worth
the if/else I'd have to add, so I just did a new one.
Factored out the base64 table init into lib.c though: that was worth sharing.
|
|
The semantics of strncat() and strncpy() are non-obvious, so let's not use 'em.
Both zero all their remaining buffer space, and with strncat() the size is
the space left at the _end_ of the string (not the size of the buffer) so
it's way too easy to stomp memory you don't own. As long as we have to measure
stuff ourselves to get it right, just use memcpy().
|
|
xfork() to portability.h and #ifdef based on __uClinux__ (which seems to be the nommu compiler define).
|