place most stuff from /etc/profile in /etc/skel/.mkshrc; admins must make
sure to copy this file to users' homes on upgrade (benefit: non-login but
interactive shells also get all the goodies); fix some quoting; simplify,
reformat, change comments
• from an mksh point of view:
slight internal changes in dot.mkshrc; external commands are now prefixed
with “ulimit -c 0”; $TERM is defined; improvement in determining the host
name (e.g. on Debian if a FQDN is not given); declare locals as such both
in $PS1 and outside; remove superfluous quoting, quote properly; simplify
hd alias, add rot13 alias; place RCS ID at the bottom
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
• if it's in x_literal() (“quote” / ^V) mode, it's accepted like now
• if it's a mb sequence start, it's rejected with a beep
• if it's a mb continuation, the whole sequence is silently rejected
this makes command line editing when accidentally hitting, e.g. with
my mircvs://contrib/samples/dot.Xmodmap, Mode_switch-x much more ro-
bust.
the same as ASCII control characters (U+0001..U+001F), i.e. with a ctrl ca-
ret and its value XOR U+0040; treat their width as 2
fixes crash+cpu hog on 'meta-tab backspace'
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
o Each input character found in the array specified by
string1 is replaced by the character in the same rela-
tive position in the array specified by string2. When
the array specified by string2 is shorter that the one
specified by string1, the results are unspecified.
So give tr <everythingbutalphanum> _ the appropriate number of underscores.
* Also strip dashes from header names.
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
precedence over POSIX/SUSv3 stuff and requires libbsd-compat which is
something we don't desire; _GNU_SOURCE even in Linux libc5 always has
included _POSIX_C_SOURCE=2 and BSD functions since at least Feb 1995.
* sync GNU/kFreeBSD with GNU/Linux, it uses glibc2
First mentioned and second response on inquiry by Bastian "waldi" Blank
Thanks!