Commit Graph

1267 Commits

Author SHA1 Message Date
tg e2b13ffeae say hello to mksh on OSF/1 V2.0
the trick is to use static linking…
2008-10-24 19:55:35 +00:00
tg a82a5e57f7 /bin/sh on DEC OSF/1 V2.0 (Digital UNIX) is a true Bourne Shell, so it sucks 2008-10-24 19:55:06 +00:00
tg 331b45af7d • OSF/1 may not have MAP_FAILED defined either
XXX mmap() works only on devices on some DEC OSes, not on files, so,
  XXX instead, it were best to disable it altogether
• bump date
2008-10-24 19:54:23 +00:00
tg e755d6d2a9 some more manual page improvements 2008-10-20 19:52:07 +00:00
tg 0c2de1902c • change mksh to only then behave more POSuXish when called as /bin/sh or
“-sh” if -DMKSH_BINSHREDUCED was passed during compilation, for example
  for Debian, but d̲e̲f̲i̲n̲i̲t̲i̲v̲e̲l̲y̲ n̲̲o̲̲t̲̲ for MirBSD™
• split up regression test to force this behaviour
• remove the gunk from our MirBSD™ startup scripts again
• mention arc4random.c changes on website, sync clog, warn packagers
2008-10-20 19:29:25 +00:00
tg 2fc9fb99d7 when doing a history search (^R), restore old input line on
abortion (^G – ^C is SIGINT and doesn’t work like this, but
that’s actually good IMO)

prompted by enquiry about the Emacs editing mode by <smultron:#MidnightBSD>
2008-10-19 20:15:45 +00:00
tg 9be489ea90 use less stack storage, prefer .bss storage (saves us a memset() call)
and .data instead of another initialisation; this was prompted by a bug
in scan-build (the value can never be NULL, but it doesn’t realise it),
although this doesn’t fix it, but less stack usage is always good
2008-10-15 10:25:01 +00:00
tg 7daf3f0b59 fix a warning
From: Elias Pipping <elias@pipping.org>
2008-10-14 19:48:27 +00:00
tg c11187f993 fix some of the things scan-build[1] found (but not some false positives)
10x

From: Elias Pipping <elias@pipping.org>
[1] http://clang.llvm.org/StaticAnalysis.html
2008-10-13 23:06:04 +00:00
tg ea72bd1b76 improve version reporting on modern AIX/xlC
XXX both cc -qversion and ld -V give errors on AIX 5.2 / xlC V7.0…
2008-10-10 21:57:16 +00:00
tg 25a8d9095d AIX has no UTF-8 locale:
aixuser@pscp520v5:~/bcc $ locale -a
C
POSIX
en_US
en_US.8859-15
en_US.ISO8859-1
aixuser@pscp520v5:~/bcc $ uname -a
AIX pscp520v5 3 5 00C56E7D4C00
2008-10-10 21:36:04 +00:00
tg 37934a07cf fix prodded by cnuke@ for AIX with IBM xlC 7.0:
fool the compiler into not doing static bounds checking when we do
one-past-the-array-boundary pointer assignments for cases where the
only accesses are like (*--pointer); bump version
2008-10-10 21:30:43 +00:00
tg 94b7792718 use mksh realpath builtin instead of readlink -f for canonicalisation
note: there’s still a readlink(1) call left in, for instance, mirmake;
this does not hurt because we initially assumed that readlink(1) does
exist anyway and bundled ours just because some do not have the ‘-f’
option for realpath(2)isation
2008-10-05 16:26:13 +00:00
tg 5d9e4c9e16 unbreak MKSH_SMALL after x_histp related changes 2008-10-05 16:06:43 +00:00
tg 52339e8a77 fix botched up manpage diff 2008-10-04 23:22:13 +00:00
tg 27ee1866fe implement Message-ID: <20081004171903.GA14184@boetes.org>
in a somewhat hackish way, and it’s still quite different from zsh,
but probably closer to a desired functionality

XXX this makes state by abusing 「modified」 and 「xmp」 (“the mark”).
2008-10-04 23:08:04 +00:00
tg 78a49e8faf miwi noticed that <libutil.h> on ViehBSE has a prerequisite header, but
didn’t tell me which one (T H A N K S !)… since I have no FleaBSD shell
account, I tried on DragonFly and MidnightBSD, which both are content
when adding <sys/types.h> first… let’s hope this fixes all 386BSD derivates
2008-10-04 19:13:22 +00:00
tg 9cd963ea45 • check.t: change history-e-minus-5 regression test to avoid false failure
caused by ignoredups history control
• histrap.c: enable ignoredups after fc -s editing too
2008-09-30 19:36:16 +00:00
tg af7fcd2498 smaller even 2008-09-30 19:35:10 +00:00
tg 051522c9ea optimise 2008-09-30 19:28:12 +00:00
tg 13231b50eb ignore more dups 2008-09-30 19:25:51 +00:00
tg d44827dc5b fixes 2008-09-30 18:48:01 +00:00
tg b24dc6e725 add regression tests, sync manpage, bump version number 2008-09-30 18:43:07 +00:00
tg 563d4b5b19 implement duplicate ignoring in the history, also requested by asarch,
and wanted by me for a while
2008-09-30 17:58:49 +00:00
tg f53a8196e4 däs isch ei buul, koa int… 2008-09-30 17:49:26 +00:00
tg 8f5eda8859 remove the problematic ‘-q’ option, which causes trouble under unclear
circumstances, like some FreeBSD 8 (beta) incarnations (yet not others)
2008-09-30 17:34:25 +00:00
tg a330895a2c implement ^Xe emacs history editing like ^[v vi history editing
cf. Message-ID: <Pine.BSM.4.64L.0809171944240.28480@herc.mirbsd.org>
2008-09-30 17:23:00 +00:00
tg b65a7f7f9e bump mksh patchlevel for today’s sorta-tested half-done changes, with more
to follow (see <Pine.BSM.4.64L.0809201417560.22066@herc.mirbsd.org>), as I
probably am not going to hack any more tonight
2008-09-20 19:18:00 +00:00
tg 09bfec553e when using search-history, ESC ends the search, however, ESC often leads
in præfix sequences (like ANSI cursor keys), leading to annoying effects
if we forget that

this patch changes the behaviour so that another character is read/peeked
at (since this is done in the main loop after ESC anyway, no function loss
through the delay) if ESC leads in a prefix-1 sequence, and if the peeked
character leads in a prefix-1 or prefix-2 sequence when in state prefix-1,
it’s still enacted (XXX document this in manpage)
2008-09-20 15:59:23 +00:00
tg 3287571386 Do not push lines beginning (at the $PS1) with an IFS White Space (space,
tab, newline) or an IFS Character ($IFS) into the history at all.
2008-09-20 14:17:30 +00:00
tg 0322c87457 EXPERIMENTAL: make it so that the last (not yet entered) line (even if
empty) appears pushed into the history, so that, when pressing cursor-up
or ^P, with a cursor-down or ^N you get it back, unless you modify a line
retrieved from the history, in which case it will overwrite the saved line
and place the current history pointer past the entered history lines

This is for Emacs mode; Vi mode had something similar already, and shares
some code and data

XXX there are several static buffers of size LINE (currently 4096) in here
2008-09-20 14:10:23 +00:00
tg 2ab0f09ed4 • since libc has OPTU-8 while mksh has CESU-8 for UTF-8 handling, we cannot
use the libc functions for converting between multibyte strings and wide
  strings in here any more, besides mksh has slightly different needs than
  SUSv3 compliance ⇒ hand-craft optimised and unrolled functions for that
• sync the mksh-internal wcwidth function with libc
2008-09-20 12:29:31 +00:00
tg a9342be98a work around GNU getopt(3) violating every single standard in existence 2008-09-19 10:41:55 +00:00
tg 8a853f24be • bring back automatic turn-on of FPOSIX if called as sh/-sh
‣ only if !MKSH_SMALL
  ‣ add appropriate regression test
• if FPOSIX is set, do not close fds > 2 on exec, Debian #499139
• add appropriate regression tests for keeping fds private or not
2008-09-17 19:31:30 +00:00
tg a04ad530a2 sync with reality 2008-09-17 19:27:16 +00:00
tg 97aaad43b2 mention that the vi editing mode is orphaned (almost no users, really no
developers, I understand about 1% of the source code only) yet still
functional (just not en par with the emacs editing mode, but no known
regressions over oksh (in -current) and better functionality than most
other korn shells, according to Yofuh)
2008-09-14 20:56:06 +00:00
tg 7cf56cf53c pull in another fix from oksh:
plug a memleak when freeing io redirection in commands.
the leaked memory is actually reclaimed when the command
finishes but may grow until that happens, e.g. during
command execution.

ok phessler@.
testing sobrado@ jmc@ oga@.
2008-09-14 20:29:13 +00:00
tg 977237ad14 • merge vi_reset() and edit_reset() into x_vi() to allow for following:
• fix vi mode (which, however, is officially orphaned) multi-line $PS1 by
  using a similar algorithm for prompt skipping as emacs mode (changing
  the meaning of prompt_trunc variable and using prompt_redraw, just even
  more efficiently than vi mode); reported by asarch via IRC
• fix multi-line prompts if last line is “too large” by using emacs mode
  algorithm of just internally appending a newline, while here ☺ this even
  saves us having to re-add the prompt_skip variable…

WARNING: this is only barely tested, as almost nobody ever uses vi mode
⇒ test yourself, there may be bugs (e.g. off-by-ones); already known is
  that the vi input line editing mode is NOT multibyte safe…
2008-09-14 20:24:59 +00:00
tg f341615e2c be more efficient 2008-08-14 17:39:30 +00:00
tg 9ab67aa02f • merge final version of the stack-free diff as committed by jaredy@openbsd
thanks for helping with the bug
• merge RCS IDs
• bump mksh version
2008-08-02 17:45:12 +00:00
tg a30066cd6f run millert’s afree checker by default (idea from openbsd) if MirOS-current
and not MirOS-stable (via DEBUGLIBS from <bsd.own.mk>)
2008-08-02 17:40:37 +00:00
tg 027e9efa85 mention MirOS OPTU-8 (and OPTU-16) encoding some more 2008-08-02 00:57:28 +00:00
tg 024f0e161d heirloom-sh and Solaris /bin/sh caught use of $NROFF before definition
10x Elias Pipping for noticing
2008-07-21 21:00:25 +00:00
tg a125045432 ptrdiff_t needs <stddef.h> 2008-07-18 11:42:52 +00:00
tg cae7468fe6 (possible) warning cleanup 2008-07-18 11:34:20 +00:00
tg 68e028ea4b fixes for constant conditionals, from gcc-4.2 fat binary building 2008-07-18 11:33:13 +00:00
tg eff47cf33b this isn't needed, from pdksh 2008-07-17 15:17:46 +00:00
tg 79de8c1eb0 add some cppflags from pdksh 2008-07-17 14:50:24 +00:00
tg eb2db9a35e add comment 2008-07-17 13:00:38 +00:00
tg 828fc5cd8b merge OpenBSD’s non-standard <bsd.regress.mk> tests 2008-07-17 12:57:59 +00:00