Commit Graph

80 Commits

Author SHA1 Message Date
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
tg 2345d8b72b more getconf/confstr fixes 2006-11-09 22:11:08 +00:00
tg 1edc9c071a fix description of setlocale stuff a little 2006-11-08 23:49:01 +00:00
tg d98866057c * set -o utf8-hack implies set +o emacs-usemeta (the default)
* we're R29 (-beta)
2006-11-08 20:32:44 +00:00
tg 9e6936ac5c irc is fun. I registered channel #!/bin/mksh in freenode. 2006-11-08 20:27:26 +00:00
tg 5e2e209d51 make this R29(beta), mksh -U turn on (or setlocale), and document. 2006-11-05 17:01:47 +00:00
tg f2eafb3044 fix description of $RANDOM, which is not limited to 15 bit any more
as a device to determine whether arc4random(3) is in effect or not.
2006-09-13 16:14:29 +00:00
tg c037d54d6d First result from the PDF review, by myself:
* a mksh -> an mksh
While here:
* fix list of shells that don't match . and .. with .* (pdksh went
  missing in transit)
* Try to make fit on 39 pages by shortening a few
  lines of redundant commentary about non-mksh books
* AT&T -> .At
2006-08-28 03:31:01 +00:00
tg 4fac7ec24b * remove redundancy
* integrate compat.h, version.h into sh.h (dependency trick didn't work anyway)
* mention #ksh in mksh(1) since the founder (twkm) said it's on topic too
  (don't remove mention of #mksh despite it's usually empty because of control)
2006-08-22 22:49:38 +00:00
tg 083f19dc53 * document the feature-not-bug status of pipeline-subshell-1
* fix spelling in regression test
* expand test-stlt-1 by reverse logic, just to make sure
2006-08-14 20:41:21 +00:00
tg 3b194eebb7 point people to the IRC channel (#mksh/OPN) 2006-08-11 13:46:32 +00:00
tg 1100be9300 re-implement "set -o posix" which doesn't do much ;)
but turns off 'braceexpand' when turned on as side effect,
just like oksh/pdksh.
document "set -o sh" too.
2006-08-09 20:44:16 +00:00
tg 500c89635f fix an omission to delete, and remove confusing ancient comment 2006-08-09 20:27:18 +00:00
tg 49d627c9f7 correct the description of "abort" 2006-08-08 20:19:14 +00:00
tg 4661992d5b remove the 'stuff' functionality altogether,
ksh93 doesn't have it, and I don't know, nor
do I care about what "the BRL ^T mini-systat
feature" is.
2006-08-08 20:17:22 +00:00
tg 5176249248 * bind ^T to transpose-chars as documented in the manual page,
not to stuff, even if TIOCSTI is available
* it's transpose-chars not transpose

bug spotted by hondza who wondered that on ^T the line repeats itself forever
2006-08-08 20:07:53 +00:00
tg 174b4c5a1d the 'delete' key does *not* act as Ctrl-D (EOT, cf. ascii(7)) 2006-08-02 14:02:55 +00:00
tg 58e5606710 bind xterm-xfree86 and wscons (NetBSD®) wsvt25/vt220 too 2006-08-02 14:00:19 +00:00
tg 52357a30be this is mksh R28 (beta)
I think of implementing multiline editing (bash-style) for R28 final,
but other than that, the new features already suffice for a new major
2006-08-02 13:34:03 +00:00
tg c96e31a707 implement a hack whereas you can now bind functions (and macros)
to keys with a trailing tilde (after prefix + control char); the
function is then invoked after prefices, control char and one more
character X are entered; if X is not a tilde, it is ungetc(3)d
2006-08-02 13:32:18 +00:00
tg bef8651936 * Build.sh: fix manpage generation defaults under Cygwin
* mksh.1: rework prompt ($PS1) section, simplify example,
  point to packaged dot.mkshrc example
* mksh.1: fix description of 'redraw' regarding redrawal
  of prompts longer than one screen line
* all: bump version/date
2006-08-02 11:50:30 +00:00
tg df54522223 * Build.sh: fix accidental CR-LF catastrophe
(yeah, that's what you get from developing with a
  16-bit MS-DOS(R) executable of your favourite text editor)
* lex.c, mksh.1: do not print the delimiting character for
  not-to-be-counted character sequences (i.e. ANSI escapes)
  in prompts any more, mostly because ASCII 01h is printable
  on both Interix and Cygwin and I'm lazy
  (this also fixes prompt width counting if a printable character
  such as 'x' is used as delimiting character)
* lex.c: through printing the prompt character by character,
  also print the delimited sequences if skipping, fixes some
  prompt redrawal not honouring colours stuff while not totally
  redrawing the entire prompt
2006-08-02 10:41:03 +00:00
tg c504a42ac1 (partial) sync with openbsd (and fix after them),
gives us a better wrapping prompt and a manpage wording cleanup
2006-08-01 14:09:20 +00:00
tg db107a9b05 bring back the 'version' editing command at "ESC ^V" like AT&T ksh93+r 2006-08-01 12:44:17 +00:00
tg 3a9ac3916a * add new book reference from #ksh (freenode) topic
* add another ksh book, referenced from amazon
* fix reference mdoc code
* add page count for the books
* fix old 10-digit ISBNs
* add new 13-digit ISBNs
* add myself as current maintainer/developer
* add miros-discuss eMail address for bug reports
* note that no book documents mksh
2006-07-27 14:45:30 +00:00
tg 80c579a758 dates 2006-07-23 14:35:44 +00:00
tg afcbdad1c5 simplify, rid use of .Mx macro (portability) and direct users to miros-disgust@ 2006-07-23 14:35:10 +00:00
tg 2ffaa5ac46 while mksh isn't designed to run as sh(1) it _can_ do it,
and in fact, Han Boetes even uses it as /bin/sh on CRUX GNU/Linux
2006-07-21 21:47:43 +00:00
tg d854fb1a8d fix date/version 2006-07-03 12:19:43 +00:00
tg 569cf64ff1 * process ~/.mksrc only if FTALKING (i.e. interactive shell)
From: hondza <miscreant@tiscali.cz>
* document that in the manual page myself
* add regression test for that myself
2006-06-21 19:27:35 +00:00
tg 8297ca20c8 * this is almost mksh R27, bump
* add the O'Reilly books as references
2006-05-10 19:30:33 +00:00
tg 7672b9b346 apply some fixes from OpenBSD and don't apply some others
but sync RCS IDs for easier future adaption:
* Simplify savefd() by removing the "noclose" flag and make noclose
  behavior the default. Almost all uses of savefd() are followed
  by an implicit or explicit close.
* fix typos
* might as well make ksh_getopt() match real getopt(), ie. get rid of that
  stupid EOF concept that was never true. adobriyan@gmail
* use SEEK_* for lseek()
* fix lint comments, no functional changes
* remove excessive optimization; from adobriyan@gmail
* only santa checks things twice; from adobriyan@gmail
* Interpret zero-filled numbers as decimal; PR 4213; from Alexey Dobriyan
2006-05-10 18:54:13 +00:00
tg e28549e4ff illustrate creative use of $PS1
requested by Jari Aalto
2006-05-08 12:12:36 +00:00
tg b0eb8f5b5e * check.t: add two mkshrc-tests (turn on, turn off)
* check.pl, check.t: add mkshrc-test whether "real" $HOME/.mkshrc interfers
* mksh.1: sync with reality: $ENV unset isn't needed, $ENV='' is enough
  to turn on ~/.mkshrc processing
2006-05-08 11:59:41 +00:00
tg c4ef5b801a New feature: read ~/.mkshrc during startup, after the profiles
have been read, for non-priviledgued shells only. If $ENV is
set, ~/.mkshrc is ignored (even if the file pointed to by $ENV
does not exist in the first place).
Feature requested by Jari Aalto for portable mksh because some
operating systems' vendors do not allow touching the profile.

Initial diff and manual page addition by Jari Aalto <jari.aalto@cante.net>
Code changes and manual page correctness by me.
2006-05-08 11:42:36 +00:00