better
with dietlibc, <ulimit.h> requires <sys/types.h>, and as we unconditionally
include the latter anyway, just add it as a scan time requirement header

from Debian package
BSDi BSD/OS 3.1’s /bin/ksh (PD KSH v5.2.8 96/08/19) is horridly broken and
removes the \n part of a “\\\n” sequence, but not the backslash ⇒ we can’t
use line continuation in a here document

someone might want to add this to *(autoconf) Portable Shell::
merge OpenBSD’s non-standard <bsd.regress.mk> tests
add comment
add some cppflags from pdksh
this isn't needed, from pdksh
fixes for constant conditionals, from gcc-4.2 fat binary building
(possible) warning cleanup
ptrdiff_t needs <stddef.h>
heirloom-sh and Solaris /bin/sh caught use of $NROFF before definition
10x Elias Pipping for noticing
mention MirOS OPTU-8 (and OPTU-16) encoding some more
run millert’s afree checker by default (idea from openbsd) if MirOS-current
and not MirOS-stable (via DEBUGLIBS from <bsd.own.mk>)
• merge final version of the stack-free diff as committed by jaredy@openbsd
  thanks for helping with the bug
• merge RCS IDs
• bump mksh version
be more efficient
• merge vi_reset() and edit_reset() into x_vi() to allow for following:
• fix vi mode (which, however, is officially orphaned) multi-line $PS1 by
  using a similar algorithm for prompt skipping as emacs mode (changing
  the meaning of prompt_trunc variable and using prompt_redraw, just even
  more efficiently than vi mode); reported by asarch via IRC
• fix multi-line prompts if last line is “too large” by using emacs mode
  algorithm of just internally appending a newline, while here ☺ this even
  saves us having to re-add the prompt_skip variable…

WARNING: this is only barely tested, as almost nobody ever uses vi mode
⇒ test yourself, there may be bugs (e.g. off-by-ones); already known is
  that the vi input line editing mode is NOT multibyte safe…
pull in another fix from oksh:

plug a memleak when freeing io redirection in commands.
the leaked memory is actually reclaimed when the command
finishes but may grow until that happens, e.g. during
command execution.

ok phessler@.
testing sobrado@ jmc@ oga@.
mention that the vi editing mode is orphaned (almost no users, really no
developers, I understand about 1% of the source code only) yet still
functional (just not en par with the emacs editing mode, but no known
regressions over oksh (in -current) and better functionality than most
other korn shells, according to Yofuh)
sync with reality
• bring back automatic turn-on of FPOSIX if called as sh/-sh
  ‣ only if !MKSH_SMALL
  ‣ add appropriate regression test
• if FPOSIX is set, do not close fds > 2 on exec, Debian #499139
• add appropriate regression tests for keeping fds private or not