in the MKSH_SMALL case… so the speed, code size, and number of insns
is the same as before for that, except that the NULL pointer check is
moved to possibly save a function call, and that the function call may
be inlined or jumped
• others: fix 6 (!) cases of non-constant or side-effect arguments
to the str_save() or str_nsave() macros, and other abuse of them
• also fix some cosmetics and other un-nice code while here
missing for a while yet its disappearance was unnoticed because…
• distrib/special/mksh/Makefile: sync check categories, this was missed
• mksh.hts: sync clog
the latter is required by HP-sUX, okay, and apparently the
preferred one by glibc (GNU libdrepper?), but breaks on al-
most all other systems I have access to (Slowlaris, Midnight
DragonFly NetBSD, Darwin, at least)
• fix file description, history, etc.
• require <stddef.h> for portable size_t declaration (if ! kernel, bootloader)
• mention why we do _not_ include <string.h> (for building on obsd/mbsd)
• sync RCSID definition with that of mksh (more portable)
• fix strlcat description
• sync strlcpy obsd rcsid and licence header with obsd-current
(their code change 1.10→1.11 was something we already did)
• use “does not”, not “doesn’t”
• make it easier to produce wcslfun.c
libc wcslfun.c:
• sync with strlfun.c (much easier now)
mksh strlcpy.c:
• sync with strlfun.c (in comments, mostly)
no binary changes
since mksh(1) did go into an infinite loop if that fails first
bug spotted, initial patch and help drafting a test case
From: Decklin Foster <decklin@red-bean.com>
note there are more instances of unlink(2) and others (like chmod(2), as
spotted by flawfinder) which aren’t checked… but at least the other case
of unlink(2) use in histrap.c doesn’t cause any trouble (I think)
and make it fit into mksh’s model (also gives us a couple of things
GNU bash doesn’t have
• add regression tests for all of these
Lukas “smultron” Upton from MidnightBSD spotted a script with /bin/sh
shebang invalidly using “&>” in some Apple backup toolkit, 10x
XXX why fds are limited to one digit?
commit inspired by fgsch:
> Log message:
> cast pointer arithmetic to unsigned so we can behave correctly on
> underflows. fixes fc -l 1 in my box where line is 1667511151.
> krw@ ok.
to signed rather. oops.