Age | Commit message (Collapse) | Author |
|
|
|
|
|
|
|
to touch it in the meantime, so no point having it in pending.
|
|
|
|
Inline #define bcg TT (from generated/globals.h)
Inline BC_FLAG with FLAG_ values from generated/flags.h.
Replace BC_MAX() and BC_MIN() with maxof() and minof() from
Inline BC_INVALID_IDX (it's used twice and doesn't need a typecast).
Inline bc_func_insertParam() and bc_func_insertAuto() (each is used once).
|
|
Coding style: declarations go at the start of blocks.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
stuff syslog.h does into lib.c and portability.h
|
|
|
|
Implement -c, fix endless loop when illegal char happens with
!outleft (don't need to check errno, just in == toybuf), refill
buffer each time (less efficient handling of illegal chars but never
have to worry about how long constitutes a valid sequence in unknown
encoding).
Fix input longer than 2k (memmove() has src/dest switched, second time through
loop in starts at offset inleft...) Made it start at beginning every time.
Switch iconv_open() error msg to show to/from and errno (rather than
hardwired english text).
|
|
|
|
|
|
A very simple implementation of fmt, good enough for my daily use of !!fmt
in vi to reflow checkin comments like this.
|
|
collapse flag arrays to fewer lines, factor out xtcgetattr(),
strip curly brackets around single lines, don't have a separate error
message for tcsetattr() return code if more thorough check is on next line,
take advantage of O_RDONLY being zero, document -F.
|
|
Top bits count too!
|
|
|
|
Full POSIX stty with Linux extensions. Output and behavior match coreutils
8.26 as far as I can tell. For some reason busybox 1.22 stty always
shows all the special characters, even when they match "sane". I've
matched coreutils, since "shows differences from sane" is easy to describe
and obviously useful.
Flags in the various arrays are not in the order they're introduced in
POSIX or in the Linux header file: they're in the order that they're
output by coreutils' stty.
The -g output matches coreutils and busybox.
I implemented iuclc, xcase, and olcuc even though they've been removed
from POSIX because the others implement them, and "man stty" defines "raw"
and "sane" in terms of them (where POSIX doesn't define "sane" in any
useful sense).
This builds fine against glibc 2.24, and as far as I can tell all the
constants used were in Linux 2.6 so I'm assuming that there shouldn't
be any #ifdef nonsense needed for any reasonable vintage of C library.
|
|
|
|
|
|
|
|
|
|
|
|
simplify strstarteq, use local variable "conv" instead of toys.optargs.
|
|
Android forces -Wformat on for all source.
toys/pending/expr.c:116:28: warning: field precision should have type 'int',
but argument has type 'long' [-Wformat]
ret->s = xmprintf("%.*s", m[1].rm_eo-m[1].rm_so, target+m[1].rm_so);
~~^~ ~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
|
|
|
|
|
|
Everyone forgets that mmap returns MAP_FAILED rather than NULL on failure.
Every use of mmap in toybox was either doing the wrong check, or no check
at all (including the two I personally added).
|
|
|
|
|
|
|
|
Also trivial cleanup of pipe -> xpipe.
Bug: http://b/38215123
|
|
|
|
|
|
The argument to help_exit is a char*, not a FILE*.
|
|
Also refactor so that legacy mode gets all the new functionality too, and
add -S to make it easier to test legacy mode on 3.5 or newer kernels (at least
on the host; on Android the syslog(2) system call is no longer allowed).
Bug: http://b/36090178
|
|
to unify the two codepaths in Elliott's rewrite.
|
|
|
|
The finit_module() system call, introduced in Linux 3.8, reads the
module from a supplied file descriptor. This allows the kernel to do
security checks based on the file's location.
|
|
While most systems have their kernel modules, modules.dep etc located at
/lib/modules/`uname -r` this is not always the case.
The -d option may be used to specify a nonstandard path for these files.
It may be used more than once to specify multiple directories where
these files may be found.
|
|
|
|
Recognize full range of linux serial speeds (only error cfsetspeed returns
is invalid speed value).
|
|
|