Commit Graph

114 Commits

Author SHA1 Message Date
tg 83b8798da3 support dæmonisation in mksh, for example
|	csh -cf '/command/svscanboot &'
and
|	/usr/mpkg/bin/pgrphack /usr/mpkg/bin/svscanboot &
can now be replaced with
|	/bin/mksh -T- /usr/mpkg/bin/svscanboot
2008-03-23 22:09:59 +00:00
tg 231b682cdf according to groff_char(7) and my own hard experiences, there is more wrong
with GNU groff – add some special handling to the BSD mdoc macros for it so
that the manual pages look good in both utf8 and ps (PDF) mode; also fix in
mksh wrong display of ` (groff: ‘), ' (groff: ’), \' (groff: ´), \- (groff:
U+2212 −), the en dash (nroff doesn’t have it, use the em dash there ONLY),
and ~ and ^ (groff: placed atop and size-reduced, for use as diacritics, in
manual pages bad since these are control characters there)
→ PDF manpage now has ‘’ “” and good-looking hyphens and mini and ~ and ^
→ utf8 manpage now has ‘’ “”, good-looking hyphens, cut’n’pasteable mini
→ nroff manpage still has '' "" instead of ugly `' ``'' or even `´
→ Debian lintian won’t complain any longer
2008-03-04 00:09:34 +00:00
tg 8a3169a0dd Patrick “aptituz” Schoenfeld mentioned “lintian -viI mksh*.changes” to
me, which points out that “gnroff -Tutf8” mangles the ‘-’ characters
(hyphen/minus) from the input into ‘‐’ characters (hyphen), which does
not make sense in many cases and prevent copy’n’paste → fix

no change in nrcon output
2008-03-03 22:38:41 +00:00
tg 36c4552e1f we don't need to be special if called as -sh any longer now 2008-03-01 02:21:38 +00:00
tg f87b33997a two small fixes: ① cvs doesn’t like me; ② .Nm only takes one word argument 2008-02-29 18:20:16 +00:00
tg 252a4b13cc use $Mdocdate here, too (extend .Dd of GNU groff first) 2008-02-29 11:03:55 +00:00
tg 85b0cb20eb almost hack ${foo//bar/baz} support for real, now
still one corner case left ☹
→ 11:09⎜«Han:#UnixNL» Ik _haat_ bash
⇒ kann ich mich nur anschließen…
2008-02-27 11:24:12 +00:00
tg 5ea53a15c7 implement “here strings” 2008-02-26 20:43:11 +00:00
tg 5468e6ee12 now we don’t need more special FPOSIX behaviour any more 2008-02-25 00:58:26 +00:00
tg d16fc19335 live code from FOSDEM: add print \xDB and \u20AC, including regression test
agreed bsiegert@
good idea and manpage diff ok'd by some netbsd person sitting next to me
2008-02-24 15:48:43 +00:00
tg 2ca968e25f • fix for the pipeline-as-coprocess problem
• bump to mksh R32
2007-10-25 13:51:19 +00:00
tg 97ba2fabc7 first step towards mksh R32 ☺
allow array indices in the uint32_t range (0‥4294967295) and map negatives
into that range; adjust manual page and regression tests; to be used RSN ☻
2007-10-18 20:32:33 +00:00
tg 80e0de3f98 mention interactive shells processing ~/.mkshrc 2007-10-14 13:43:17 +00:00
tg 307330bee2 be more accurate but terse regarding pipe sequences
somehow, variables don’t propagate up much more often
2007-09-26 19:26:58 +00:00
tg 957291d4b8 sync: “unset” always returns zero as per SUSv3 2007-09-09 19:18:59 +00:00
tg ca46f3dc98 new builtin “rename” (this name sounds better than “mksh_mv_rescue” ☻)
to just call rename(2) directly, e.g. if /bin/mv needs /lib/ld-uClibc.so.0

some assorted code cleanup
2007-08-19 22:06:27 +00:00
tg 49c95a8938 put clear-screen on ESC ^L as suggested by the AT&T ksh people in
http://www.opensolaris.org/os/community/on/flag-days/pages/2007081701/
2007-08-18 01:20:28 +00:00
tg e99f988aae feature freeze for mksh R31, to be released as part of MirOS #10 2007-08-18 00:22:09 +00:00
tg f684b0ceb1 Implement the “source” command, as requested by some and agreed bsiegert@
In contrast to AT&T ksh93, its semantics are like GNU bash in that it ap-
pends the current working directory to the search path; it is implemented
as a shell alias instead of enhancing funcs.c:shbuiltins[] like in ksh93.
2007-08-13 19:39:21 +00:00
tg 7381c6c274 mention that $RANDOM is _always_ 15-bit unsigned integer, even arc4random’s 2007-08-12 14:01:38 +00:00
tg 499327f7b8 add “set -o arc4random”, RTFM for details 2007-08-12 13:42:23 +00:00
tg 47836e45e7 add a new bindable command “clear-screen”, which can be bound to the ^L key
so that archite@midnightbsd won’t have to add evil kludges to oksh again if
they switch their ksh to mksh ☺

both “clear-screen” and “error” aren’t bound; default binding for ^L stays,
as usual, “redraw” (principle of least surprise); however GNU bash converts
also might want to put “bind ^L=clear-screen” into their ~/.mkshrc.
2007-07-31 15:29:40 +00:00
tg b8a693ed68 mention ${foo:2:3} limitations 2007-07-26 13:32:16 +00:00
tg 78d58de7a0 fix the rest of it 2007-07-06 02:22:57 +00:00
tg ca17798533 this is bash compatibility week, and by suggestion of actual users,
namely Dr. Robert “Pfeffer” Arnold (in this case, in FreeWRT), make
a half-completed attempt at implementing ${foo:2:3} substring evals
(of course, negatives can't work right now and that the numbers are
in face expressions is something I only read later too – this is to
be revisited later, but it's already late)

don't depend on this behaviour yet though

if someone wants to add more regression tests, feel free to…
2007-06-27 23:12:59 +00:00
tg 7796820c82 now that we're definitively at 40 pages for the PDF manual, revert some of
the changes in r1.81, and improve wording further
2007-06-23 19:07:14 +00:00
tg 3a94b076a0 implement bash-style array initialisation, as requested by many
still experimental
2007-06-22 23:34:42 +00:00
tg e596de4759 make sure that “integer” and “local” are defined even in FPOSIX mode, which
is a compromise anyway; these lunox people will have to live with that, too
many existing korn shell alike scripts depend on it even if not on the full
korn shell syntax availability (note: this doesn't mean using these in some
script with #!/bin/sh is ok)
2007-06-17 00:50:09 +00:00
tg 199994fed8 we can do all that 2007-06-16 15:02:56 +00:00
tg 5fe1f4d416 document the FPOSIX stuff 2007-06-15 22:04:06 +00:00
tg c9991d996f • change version number to “R29 and up” so
that I don't have to bump it every time…
• amend description of emacs-mode “redraw”
2007-04-30 19:16:30 +00:00
tg fe04b78310 oops, this of course documents mksh R29c (and up) 2007-04-23 11:41:47 +00:00
tg 680e8ebd3f if we read an utf-8 BOM, enable the utf8-hack flag (we can test for that on
mirbsd even because the main.c enabling is only run for interactive shells)
2007-04-15 12:28:38 +00:00
tg dbf38a152d fix a typo and shrink it to 39 DIN A4 pages 2007-03-10 21:14:07 +00:00
tg d306d5a9e4 fix setlocale check descr 2007-03-10 00:34:54 +00:00
tg 83c2ee87f4 • remove strcasestr.c, use home-grown implementation¹, call it stricmp,
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
2007-03-04 03:04:28 +00:00
tg 939a9dea33 wording 2007-01-18 16:23:52 +00:00
tg 7056c561ec if .Nm is used with arguments, it needs the name, always (groff 1.15) 2007-01-18 00:00:27 +00:00
tg bca0f4d603 * Build.sh, histrap.c: prevent testing of strsignal() if we have sys_siglist[]
* mksh.1: .Nm is never used with "" as argument, fixes GNU groff 1.15
2007-01-17 23:47:15 +00:00
tg 29b62b186d okay, this didn't work out; changing window sizes when we're
actually within a (the emacs) editing mode does not work at
all, whether forced or not, only if we leave the editing mode
(at end of input); probably due to it saving stuff from e.g.
x_cols into xx_cols, etc.

-> remove SIGWINCH handling(!)
-> TIOCGWINSZ is now executed at end of every input line
-> use 'ESC #' if you direly need to change line size
2007-01-14 01:56:23 +00:00
tg 36e761840e * do *not* check the terminal size after each line processing,
only if we got a SIGWINCH -> interactive use speed-up on the
  slower boxen (slowness courtesy of otto@obsd)
* ^L (redraw line) now (always) checks window size; use this
  instead if required while editing the prompt; changes to the
  variables will still be propagated after the line is entered
2007-01-14 01:09:09 +00:00
tg b725114422 use RLIMIT_AS, after much RTFM 2007-01-06 18:48:27 +00:00
tg 9ecf60f6e5 CPPFLAGS+=-DMKSH_SMALL is not the only functionality-reducing option,
yet the others are not similar (mostly: OS reduces functionality, eg.
SunOS doesn't do persistent history, Minix some job control, Plan 9!)
2006-12-11 20:00:28 +00:00
tg 15a0b1a021 catch up openbsd manpage changes: typos; from alf schlichting,
and revisit the RLIMIT_AS issue
2006-12-06 13:46:28 +00:00
tg 98e9111bbc remove the "set -o sh" option (dummy anyway),
"set +o emacs-usemeta" and "set -o vi-show8" which are always on now,
since we have proper internationalisation (i.e. utf-8) support, and
assume the user either has a 'C' locale and can't enter 8-bit chars,
his terminal is 8bit-transparent, or he has a 'UTF-8' locale.
2006-11-19 20:43:14 +00:00
tg b21875f20f document hidden behaviour of typeset to clear flags from a certain
set if any other from that set are touched
2006-11-19 17:00:32 +00:00
tg c2e79abc08 make mksh compatible to the AT&T ksh spec which says, according to
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
2006-11-19 16:43:43 +00:00
tg dd63deb8b7 work around a bug in the GNU implementation of the Berkeley mdoc macros
cought by crib in IRC, thanks

(our textproc/groff port is unaffected since it uses the MirOS implementation,
 a BSD derived one with fixes, by default instead but can reproduce the defect
 with -mgdoc instead of -mdoc as parametre)
2006-11-16 13:05:39 +00:00
tg 62d9cf9fa9 only auto-enable set -o utf8-hack (set -U) for interactive shells 2006-11-12 10:44:42 +00:00
tg 493ad928e3 if MKSH_SMALL, disable persistent history code as well (like on Solaris,
where it can't work anyway), and fix that code to shrink
saves 2071t 20d 5i
2006-11-10 05:23:14 +00:00