mksh was configured to have utf-8 mode “always on” (because it's
really only always on for interactive shells); setting it to really
always on would break the other half of this regression test, so
do the optimisation only if MKSH_SMALL
do not start with a "#!shell" sequence” part of mksh(1) true again; this
was probably lost in mksh R21 or so when I decided/saw that our kernel
always parses shebang lines (code written myself, not taken from pdksh
again or MirBSD kernel, but verified against both)
• bom+shebang execution now works, no need setting EXECSHELL in the test
• bump version
starting with an UTF-8 BOM before the shebang can be executed correctly;
this would succeed if either mksh parses the shebang line instead of re-
lying on $EXECSHELL or the kernel supports it
bsiegert@ ok's my attempts to fix this
given to execute, standard input (interactive or not), via -c command line
argument, or after “eval”, but not for $(…) comsubs, at the beginning of a
subsequent line, or within a line, etc.); regression test for it
idea during my “week off” (despite the pain), bsiegert@ thinks it's good –
and utf-8 capable tools ought to be able to do this anyway
and have it return an API-correct const char *
• enhance and stylify comments
• a little KNF and simplifications
• #ifdef DEBUG: replace strchr and strstr with ucstrchr and ucstrstr
that take and return a non-const char *, and fix the violations
• new cstrchr, cstrstr (take and give const char *)
• new vstrchr, vstrstr (take const or not, give boolean value)
• new afreechk(x) = afreechv(x,x) = if (x1) afree(x2, ATEMP)
• new ksh_isdash(str) = (str != NULL) && !strcmp(str, "-")
• replace the only use of strrchr with inlined code to shrink
• minor man page fixes
• Minix 3 signames are autogenerated with gcc
• rename strlfun.c to strlcpy.c since we don't do strlcat(3) anyway,
only strlcpy(3), and shorten it
• dot.mkshrc: move MKSH=… down to the export line
to not disturb the PS1 visual impression ☺
• dot.mkshrc: Lstripcom(): optimise
• bump version
¹) side effect from creating API-correct cstrchr, cstrstr, etc.
uses goto so it must be better ☻
tested on mirbsd-current via both Makefile and Build.sh
sequence is eaten before the command is called; cought by <TGEN>
(Thomas E. Spanjaard) via IRC
fix is to tabcomplete a newline to singlequote+newline+singlequote
* bump version
side (I don't have capacities to scan 71711 files in MirOS for a
standards-compliance whack)
* copyright: mention CVS changelogs as place of contributors' name
and credit information, too
* check.t, sh.h: bump
* 'sigseen' in Build.sh goes away
* Signal name existence is checked in this order:
have our own¹ -> sys_signame[] -> _sys_signame[] -> build our own²
* Signal description existence is checked in this order:
sys_siglist[] -> _sys_siglist[] -> strsignal() -> NULL³
¹ Predefined list of items, for operating systems where we
cannot build² them, i.e. Plan 9 and Minix 3 (e.g. no $CPP -dD)
² The usual cpp(1) stuff
³ Changed later, see below
* Make $CPP test dependent on $NEED_MKSH_SIGNAME (others can
be added here, this is not absolute)
* Make signal name list generation² dependent on $NEED_MKSH_SIGNAME
* Fix check if the generation worked
* Guarantee that sigtraps[*].name and sigtraps[*].mess are valid
C strings; this makes the code shorter *and* removes a few pos-
sible nil pointer dereferences
* Embed autoconf'd usages of sys_sig* / strsignal / mksh_sigpairs
into inittraps()
* Check for each signal 0<=i<=NSIG that
name is not NULL or "" -> replace with ("%d", i)
mess is not NULL or "" -> replace with ("Signal %d", i)
name does not start (case-insensitive) with "SIG" -> name += 3
* In gettrap(), fix check if signal name starts, case-sensitive
or case-insensitive, depending on need, with "SIG" (bug from millert@)
Other changes:
* Build.sh: ac_test[n]() are documented
* Build.sh: ac_test[n]() can have negative prereqs as well now
* Build.sh: use <<-'EOF' consistently
* bump patchlevel to today
to strcasestr, it was used in a wrong way (reverse logic error in
checking its return value), turning to mis-detection of UTF-8 locale.
* sh.h, check.t: bump version
* copyright: bump year
twkm (from #ksh on freenode), that $RANDOM is always an unsigned
15-bit decimal integer.
(RANDOM << 15 | RANDOM) thusly yields 30 bit, which is still more
than 36^5, so we can use it on the baselife CD to speed things up
* edit.c: remove debug stuff again; next time better use shl.c functions ;)
* sh.h: add format attributes to a few shf functions
* histrap.c, var.c: fix format string mistakes
* main.c, sh.h: error_prefix and warningf take bool not int
* misc.c: make chvt() stuff use shf_* functions
* misc.c: rewrite the TIOCSTTY stuff to be better integrated in mksh,
since it originally was an external patch
* misc.c: chvt() no longer fails if e.g. chown fails due to e.g. R/O / fs
* var.c: fix typeset padding for right-justified zero-filled
17:38⎜«hondza:#mksh» fail ../mksh/check.t:IFS-space-colon-3 (as expected)
17:38⎜«hondza:#mksh» FAIL ../mksh/check.t:integer-base-5
17:39⎜<mirabile:#mksh> interesting
17:40⎜<mirabile:#mksh> why does integer-base-5 fail?
17:40⎜«hondza:#mksh» j=~3
17:40⎜«hondza:#mksh» ~3 expands to /tmp/3
17:40⎜<mirabile:#mksh> aah, nice catch
17:40⎜<mirabile:#mksh> that must be quoted of course. bug in the test.
17:41⎜<mirabile:#mksh> can you try with j='~3'
17:41⎜<mirabile:#mksh> I'll commit that in an instant then
17:42⎜«hondza:#mksh» yeah, quoting it worked
17:42⎜<mirabile:#mksh> thanks
17:42⎜«hondza:#mksh» :)