mksh Changelog

What's new in mksh R47

Jul 26, 2013
  • [tg] Do not accidentally remove lksh.1 for in-srcdir builds
  • [tg] Fix post-build non-‘-Q’ output for lksh
  • [tg] Silence some configure-time warnings for clang-3.2 and GCC
  • [tg] Prevent recursion loops for namerefs; found by ormaaj
  • [tg] Replace wcwidth code by mine based on Unicode 6.2.0
  • [tg, Alexander Polakov] Fix quoting in word part of ${var+word}
  • etc. when the expression is in a quoted brace or a here document
  • [tg] Fix some compiler warnings; improve sig{,handler}_t detection
  • [tg] Keep SIGCHLD blocked in some more semi-critical code paths
  • [tg] Fix uninitialised variable causing random nōn-numerical input
  • to be accepted and acted upon in the select built-in command
  • [tg] No longer chown(2)/chmod(2) the -T tty(4) argument
  • [tg] Don’t fork(2) if the -T tty(4) argument begins with ‘!’;
  • eliminates the need for things like oneit_line/cttyhack/etc. on Linux
  • [jca] Fix “for var in; do” to not be interpreted as “for var; do”
  • [tg] Use %zu for printing size_t (ipv %lu with casting around)
  • [tg] use ${SIZE-size} for lewellyn’s cross
  • [fgsch, espie, millert, tg] Write more testcases
  • [millert] POSIX specifies that for && and || lists, only the
  • exit status of the last command matters for “set -e”; fix and document
  • [millert] check.pl: Add -T flag to set the tmpdir; use
  • mkstemp(3) and mkdtemp(3) instead of $$ in /tmp for tempfiles
  • [jca] Make $(

New in mksh R40f (Apr 9, 2012)

  • [tg, RT] Implement fcntl(2)-based advisory locking as an alternative iff flock(2) is not found (LP: #912691); keep trying in the face of EINTR
  • [tg] Fix severe regression wrt. initialising tty(4) states
  • [tg] Improve testsuite, build-time checks and debugging output
  • [tg, RT, winstonw] Improve portability to BeOS (works), Cygwin (good), Dell UNIX (works somewhat, but not with gcc), LynxOS (works somewhat), NeXTstep (works but not OpenStep 4.2), USL C compiler, SCO OpenServer (good), SCO UnixWare (good), Plan 9 (still broken), Syllable Desktop (broken?)
  • [tg] rlim_t is supposed to be unsigned
  • [tg] Some code, warning and spelling cleanup
  • [tg] New Build.sh environment configurable: AWK (= awk)
  • [tg, DONG-DONG YANG] Add safety net in the Emacs line editing code
  • [tg] No longer rely on env(1), id(1), printf(1) in the testsuite, and strcasecmp(3), strcasestr(3), strncasecmp(3) in the code
  • [tg, stsc, RT] Reduce system requirements of check.pl further

New in mksh R40e (Mar 26, 2012)

  • [tg, Jilles Tjoelker] skip readonly check in unevaluated ternary twig
  • [tg, anonymous] fix all remaining ifs.sh testcases
  • [tg] No longer try to build with GCC and C99 extensions
  • [tg, Jilles Tjoelker] Do not expand aliases in COMSUB twice
  • [tg] Honour UTF-8 multi-byte character boundaries when doing partial tab-completion insertions (LP: #909025) to fix RedHat BZ#745702
  • [tg] Fix R40 (BZ#496791) regression with IOACT in TIF (LP: #907224)
  • [tg, ft] Darn persistent history code worst offenders (LP: #906914)
  • [tg] Fix some gc-sections, GCC and Clang/scan-build warnings/issues
  • [tg, 28C3] dot.mkshrc hash functions: partially address LP: #909818
  • [tg] Only compile divmod(0x80000000, -1) code in when not unneeded
  • [tg, RT] Move mirtoconf checks and INCLUDES_ONLY parts of sh.h around to ensure prerequisites are always available
  • [tg, RT, ir0nh34d] Pass mksh.exe to testsuite, if such thing is generated, and deal with Cygwin passing just “mksh” in argv[0] in such cases
  • [tg] Imply -DMKSH_ASSUME_UTF8=0 on MSYS; optimise checks
  • [tg, Jb_boin] Fix regression introduced in R35b by jaredy’s security patch where TTIME trashed a non-TCOM string argument (e.g. in TFOR)
  • [tg] Better support for tcc; fix GCCism that accidentally crept in
  • [tg] Deal with UTF-8 when reporting jobs’ commands
  • [RT] Add SkyOS to known OS list
  • [tg, RT] Support Minix in its variants Minix 3 and Ninix 3 better
  • [tg] Drop some Android-specific unused code (lsmod builtin)
  • [tg, RT, lewellyn] Support QNX and various versions of BSD/OS better
  • [tg] More code cleanup and new developer-only debugging functions
  • [tg, Andrew Kudryashov] Fix some tab completion related escaping bugs
  • [tg, draenog] Honour COLUMNS and LINES from the environment in scripts
  • [tg, winstonw] The sleep built-in utility now blocks more signals
  • [tg] Warn when using another deprecated function that will be removed

New in mksh R40b (Jul 17, 2011)

  • [tg] Don’t busy-loop on nameref ARY=ARY (LHS = RHS)
  • [tg, yofuh] Tabcomplete ~foo like $FOO (LP: #710539)
  • [tg] Code cleanup, style, and minor assorted fixes
  • [tg] Tabcomplete ~foo/M↹ (with slash) economically
  • [tg] Add new experimental global builtin, doing the same as local (typeset, really – but that doesn’t deserve its name) does, except localising all parameters it touches
  • [tg] Better error messages with non-integral environment imports
  • [tg] $RANDOM environment import accepts any string now
  • [tg, Lucas Holt] Add setenv cshism to dot.mkshrc
  • [tg, Johannes] Allow ^C to interrupt the built-in cat(1)
  • [tg, Arkadiusz Miśkiewicz, Kacper Kornet] Fix mksh taking down the entire terminal, hard, when scripts use $COLUMNS and fork off utilities; regression introduced in mksh R37 (sorry, no regression test possible)
  • [tg, Arkadiusz Miśkiewicz] Properly mark need-ctty regression tests
  • [tg] MKSH_NO_EXTERNAL_CAT – Quell the external cat(1) calls magic
  • [tg, Arkadiusz Miśkiewicz] Yes, “echo” is not portable, document
  • [tg] Improve content and look of the manual page
  • [tg] Move /etc/{,suid_}profile to /system/etc/ on Android
  • [tg] Prevent more compiler warnings; catch build errors earlier

New in mksh R39c (Feb 27, 2010)

  • [tg] Build system, code, docs and testsuite cleanup, also style(9)
  • [tg] Build.sh now requires people to whitelist conftest*.c
  • [tg] AIX builds no longer pull in libcrypt uselessly by default
  • [tg] Parse and evaluate ${parameter op word} correctly
  • [tg] Fix possible SIGSEGV in interactive mode bind builtin due to mis-optimisation of gcc combined with a bogus prototype; discovered by Grml.org's Frank Terbeck (ft), thanks!
  • [tg] Prevent Build.sh from accidentally removing mksh.1

New in mksh R37c (Apr 10, 2009)

  • Improve præprocessor detection/work in Build.sh
  • Decouple MKSH_CONSERVATIVE_FDS from MKSH_SMALL
  • Enable MKSH_CONSERVATIVE_FDS by default on Minix 3
  • Work around the (in-)famous ACK "const" bug
  • Optimise structure alignment and padding; Closes: #522778
  • Retain LOCPATH (for glibc locale) in check.pl
  • Document, simplify and clean up the code better
  • Use mirbsd.org eMail addresses consistently

New in mksh R36b (Dec 15, 2008)

  • Add check for naming the output file “scn” instead of “a.out” or “a.exe” when compiling scn.c, for Haiku, from Adam “replaced” Hoka
  • Rewrite utf_backch macro and x_bs2 function into a combined x_bs3 function for the Emacs editing mode, to optimise them and get rid of the use of __typeof__ (suggested by Anders “ragge” Magnusson after the problem was spot by replaced) and one of the uses of the statements-as-expressions feature
  • Add mirtoconf check for nice(3), missing on Haiku
  • Remove all uses of the statements-as-expressions feature by rewriting the source code accordingly and optimising some parts
  • Recognise nwcc (Nils Weller’s C compiler) in Build.sh
  • If exists, pull it in for strcasecmp(3)
  • Welcome QNX/Neutrino; work around broken /bin/ed
  • Simplify, shorten, speed up PS1 in dot.mkshrc
  • Remove some dead code courtesy of scan-build native runs
  • Add some casts to prevent LLVM+Clang warnings
  • Work around llvm-gcc-4.2.1 -Wformat pickyness
  • Add new Build.sh option ‘-llvm’ (clang, llvm-gcc)
  • Speed up mirtoconf if ‘-DMKSH_ASSUME_UTF8’ is set
  • Add the workaround for Debian #492377 into the main mirtoconf function (hiding gcc errors during the configure phase) because Gentoo has similar scanner issues; reported by Hanno Böck
  • If an MKSH_SMALL has arc4random(3), skip the rand(3)/srand(3) fall-back altogether to shrink size, also removed need for time(3)
  • Fix alias expansion recursion check if the word to be expanded is immediately followed by end of input, add test case; spotted by Michael Hlavinka in pdksh and mksh; RedHat #474115
  • Fix string/wdstring confusion preventing bashiop (&>foo) to work inside a function, add regression test, limit to 99 fds
  • change regression tests to set -U or set +U instead of set -o utf8-{hack,mode}, as well as query using $- ipv $(set +o) (easier and more reliable)
  • Add comment to regression tests which can fail on slow machines or Cygwin environments due to timing issues
  • Remove a lot of superfluous casts, improve type cleanliness
  • Insert a couple of /* CONSTCOND */ for lint

New in mksh R35b (Jul 19, 2008)

  • IRIX also has no UTF-8 locale at all, confirmed by Elias Pipping
  • Fix regression test suite for MKSH_SMALL
  • Bring in latest changes from oksh (OpenBSD ksh, not DeliLinux crap)
  • Fix abuse and unsafe use of str_save() and str_nsave()
  • Optimise the implementations of str_save() and str_nsave()
  • If MKSH_AFREE_DEBUG is defined, guard against afree()ing a pointer which has not been allocated from the given pool, from Todd C. Miller
  • Fix attempt to free a pointer to stack (function-local) storage when redefining a function containing a call to the �time� built-in, discovered by Elias Pipping, patch by Jared Yanovich, help from Todd C. Miller
  • Protect a little against people not running �./test.sh -v� but calling it with, for instance, GNU bash (as homsn did�)
  • Honour $PERL environment variable in test.sh, improve scanning for Perl, do not use potentially undefined $^O, print Perl version
  • Add as requirement (dietlibc)
  • Work around bug in BSD/OS 3.1 /bin/ksh (PD KSH v5.2.8 96/08/19)
  • Add regression tests from OpenBSD�s suite
  • Use better CPPFLAGS for AIX, Minix 3 (from pdksh)
  • Expose the �s != NULL� str_[n]save_() API and use it where the string can never be NULL (local stack storage), from gcc-4.2 warnings
  • Clean up pointer-to-integer-cast warnings in the mirtoconf process

New in mksh R35 (Jul 12, 2008)

  • Simplify and refactor the ulimit builtin, partially from oksh
  • Some style cleanup; use appropriate integer types
  • Fix a bug in table (e.g. kill -l, tab completion) display: the width of non-ASCII characters is now honoured in the utf8-hack mode
  • Improve handling of invalid UTF-8 in certain areas, and multibyte (UTF-8 / CESU-8) in general
  • When using typeset -Z�n�  on an integer variable with a base other than ten, zero-pad the value instead of the base  pdksh, oksh, zsh, and AT&T ksh93 are wrong here; GNU bash doesn t even have typeset
  • Improve parsing of set o  output where done (dot.mkshrc, check.t)
  • Improve regression tests
  • Support for base-1 numbers: in non-utf8-hack mode, 1#x  means the same as the ASCII code for x  (e.g. 78hex), where x  is any single octet (byte); in utf8-hack mode, x  is either a valid and minimalistically encoded UTF-8 multibyte character in the range 0000 %FFFD, or a single octet with no trailing octets (bytes), which will then be converted as if it were an ASCII value, or, if bit7 is set, be mapped into the PUA range of EF80 %EFFF assigned by CSUR for this purpose; this mapping is, in both cases, bidirectional; the planned base-0 number support is not possible with the code, so use base-1 (with utf8-hack disabled, or & 0xFF) instead (while it is recommended to parse only single octets, there is a regression test showing correct and safe multibyte parsing, which however is error-prone to implement and thusly not recommended)  genial  replaced@TNG, this sounds fun  ggergely, agreed bsiegert@ and others
  • Pull in more current versions of supplied files; use Unicode 5.0
  • Clean up unused definitions in build system; document MKSH_CLS_STRING
  • Remove advertising clause from copyright file; while we d be pleased to be mentioned if something contains our code, tg@ will no longer enforce the requirement to advertise with that specific formula, and we d prefer if people remember the OpenHAL vs ath5k incident and that they cannot simply change licencing of existing code; patches sent to the MirOS Project for inclusion shall be accepted if they re agreed to match this licence
  • Simplify dot.mkshrc sample file: licence is merged into the main copyright file; AT&T ksh93 compatibility was improved
  • Fix a display problem regarding fullwidth characters (e.g. CJK)
  • Set the C  locale in Build.sh for tool execution; otherwise, certain OEs behave strange; thanks to Adam replaced  Hoka for spotting
  • Use en_US.utf8 as UTF-8 locale for the testsuite for now
  • If setlocale(LC_CTYPE, "") is not available, look at the environment variables ourselves  brings UTF-8 support to poor OSes
  • Remove some now-dead code; speed up configuration process; shrink
  • Default to no setlocale(3) due to stubbed or missing locale support on GNU/Cygwin, OpenBSD, OSF/1 in Build.sh; a few more that are quite unlikely to have a UTF-8 locale: BSD/OS, Interix, Minix, PW32, Ultrix, AT&T UWIN; default to always UTF-8 on Plan 9
  • Fix for testsuite unexpected failure if running as root in one case
  • Initialise all shell integer variables (OPTIND, PPID, RANDOM, SECONDS, TMOUT) to base 10
  • Reintroduce from mksh pre-R24 shell integer variable PGRP set to the PID of the process group leader via getpgrp(2)
  • New shell integer variable USER_ID set to the geteuid(2) and used by dot.mkshrc to speed up logins, saves a spawn of id(1), mentioned by and realisation planned with Andreas "gecko2" Gockel
  • Fix dot.mkshrc tilde replacement in both $PS1 and the pushd/popd/dirs implementation when the home directory is empty, the root directory, or ends with a slash (disable replacement in that case)
  • Support dietlibc, force it into providing a BSDish caddr_t
  • Do not use LDFLAGS and LIBS while compiling with -c
  • Add realpath(3) builtin, to further speed up logins and chdirs
  • Optimise the code somewhat by making use of possible assumptions
  • Set the C  locale in test.sh as well to quell warnings
  • Split the regression tests that use locale between en_US.utf8 and en_US.UTF-8, since not all OSes support either one, and make only HP-UX and GNU use the latter
  • Fix kill, mknod(8) builtin usage msg, from Igor Sobrado via oksh
  • Use proper ptrdiff_t casts for pointer arithmetics, inspired by an oksh commit from Federico Schwindt
  • Remove check category pdksh  from check.t and test script
  • Improve Darwin, OSF/1, HP aCC, SUNpro version reporting
  • Support GNU bash &>  extension, even better than they do, suggested by Lukas smultron  Upton from MidnightBSD
  • Basic support for LLVM clang in the build system with experimental ccc  compiler driver; llvm-gcc worked as-is before already
  • Better support for contributed arc4random.c file
  • Do not spin if unlink(2) fails on $HISTFILE, from Decklin Foster
  • Dump the perl(1) $^O variable in test.sh to logs
  • Pull in latest changes from oksh
  • Allow white space between a here string indicator and the string, accidentally discovered by twkm (#ksh, freenode)
  • Allow fd specifications outside the 0 %9 range for I/O redirections, and bounds check them to be lower than the FDBASE definition, currently still 10 if MKSH_SMALL, 24 otherwise (unportable)
  • Improve the regression test suite: for one test, we had a bizarre constraint telling it won't work on UWIN, which was based upon false assumptions, but Tru64 would fail it since its cat(1) unexpectedly outputs some error messages (fix by closing stderr for cat); another test would unexpectedly print no error message on Solaris (fix by making the error message optional in the perlre(1) used)
  • Switch back to en_US.UTF-8 for glibc, Debian can do both, Mandriva fails on en_US.utf8 (XXX no libc5 auto-detection to disable it)

New in mksh R33d (Apr 12, 2008)

  • Move a portability define from sh.h to the setmode.c helper, as it�s only needed there, and we want to use the latter from MirMake as well
  • SECURITY: when spawning mksh on a new terminal, for example with sudo mksh -lT/dev/ttyC7, flush all of that tty�s I/O first
  • dot.mkshrc: ensure �ls� is no alias, don�t hardcode its path

New in mksh R33c (Apr 3, 2008)

  • Handle Ultrix mmap(2) having a different prototype (returning a caddr_t instead of a void * and not defining MAP_FAILED; making Ultrix 4.5 a fully supported platform
  • Decrease code size and optimise (using puts-style functions instead of printf-style functions for fixed strings; bool instead of int)
  • Correct behaviour of �export�, �export -p�, �readonly�, �readonly -p�, �typeset�, �typeset -p�, �typeset� and their respective descriptions in the manual page; problem reported by Danijel Tasov
  • Work around dup2(2) problem (preserving the close-on-exec flag) on Ultrix using code from mirbsdksh-1.11, lost in oksh
  • Clean up Build.sh a little more
  • Correct quotes and some other stuff in the regression tests; fix for running with old Perl (5.002 or so, Linux 2.0, BSD/OS)
  • Export the new �__progname� and �__perlname� environment variables to the suite run from check.t in check.pl
  • Do not mistake IBM xlC and VisualAge for different things, thanks to Pascal �loki� Bleser from OpenSuSE for information on them