Commit Graph

1543 Commits

Author SHA1 Message Date
tg f349aeab3c be more robust against things like Debian #535970
reverts and rewrites the code from cid 10047C1EBA57E4F4AF0

XXX find out if this is done right
2009-07-06 15:06:25 +00:00
tg 0b4b689c92 note that ${foo//bar/baz} may need the pattern escaped; discovered by me
for # and %, and by Matt Lewandowsky («lewellyn:#ksh») for & as pattern.
2009-07-06 09:37:03 +00:00
tg 3ba2780eb3 another fix from oksh for Vi Mode word erase handling, appears to unbreak
more from cid 1004A2D72DD5A4E4B4F tried to be fixed in 1004A300A72701188E3
but I’d appreciate someone who actually uses Vi Mode to test it:

   Revision 1.26: [7]download - view: [8]text, [9]markup, [10]annotated - [11]select for diffs
   Mon Jun 29 22:50:19 2009 UTC (5 days, 14 hours ago) by martynas
   Branches: [12]MAIN
   CVS tags: [13]OPENBSD_4_6_BASE, [14]OPENBSD_4_6, [15]HEAD
   Diff to: previous 1.25: [16]preferred, [17]coloured
   Changes since revision 1.25: +10 -5 lines
make VSEARCH werase act like regular werase after the last change.
vi back-words and emacs kill-region are not completely the same.
ok merdely@, millert@.  "Get it in" Darrin Chandler
2009-07-05 13:56:48 +00:00
tg 5048a75ca4 pure RCSID sync with oksh; Decklin Foster was faster than Stefan Pettersson
*and* reported it (mksh R33d on Debian) to the right people :þ
2009-07-05 13:51:09 +00:00
tg fd0ddd5902 add a DJB cdb hash implementation in mksh, which, for speed, uses a
global variable ipv print’ing the result for reparse. conveniently,
it’s already typeset just right (unsigned hex integer, zero padded)
2009-06-22 17:38:39 +00:00
tg 261cabad23 fix $@ vs $* mix-up 2009-06-22 17:27:22 +00:00
tg 25ea755f54 wbx@ requested that his feature is not called his feature 2009-06-21 15:43:17 +00:00
tg e1d8d7ed01 capitalise AT&T® 2009-06-11 12:42:21 +00:00
tg be7764778f die, gcc, die! if main is called with 2 args, I can very well
use just the first one, grml...
2009-06-10 21:25:39 +00:00
tg ac6bdf61a4 get rid of a redefinition warning 2009-06-10 19:34:18 +00:00
tg 3cec01a6fd • Fix problem with ^w fix that broke 'B'
Found by Daniel LEVAI
  Fix by Darrin Chandler
  ok millert@
  From merdely@obsd
• more tabs→spaces while here
2009-06-10 19:33:16 +00:00
tg 0432f97ffe more KNF, mostly whitespace, this time more manual labour applying style(9) 2009-06-10 18:12:51 +00:00
tg 39bb71fc54 Save another couple of bytes in the !ulimit case 2009-06-10 18:11:27 +00:00
tg 632ddd50a7 Add MKSH_NO_LIMITS, to define which has the same effect as the
absence of RLIM_INFINITY, namely make c_ulimit() into a true
2009-06-08 20:52:28 +00:00
tg 571546c562 • Check if killpg(3) is available; if not, use kill(2) with negative
process ID and hope it works (is POSIXly killpg-endowed)
• bump version
• sync clog
2009-06-08 20:34:40 +00:00
tg 5613b3a5ac and today’s last oksh merge, from merdely: I quote:
"make ksh vi mode handle werase more like vi. It's really irritating to
have whole paths go away on ^W instead of just the last bit."

"That looks right to me" millert@, "YES kthx bye!" thib@


.oO(there are vi mode users?) We are not GNU bash, good idea! tg@
2009-06-08 20:22:19 +00:00
tg 0e7b44814b RCSID sync with oksh: cid 10049D8938D01A15AB7, 10049D8A41E43689C5A
already provided this functionality with much more verbose ci msgs
2009-06-08 20:16:01 +00:00
tg bbf00b5d93 merge fix from oksh:
"let --" was crashing ksh; found by phy0@rambler.ru.  Various other expressions
involving ++ and -- also ran into this. Insufficient checks for end of parse in
the tokenizer made it assume that an lvalue had been found
2009-06-08 20:13:07 +00:00
tg 6b2ad96bac some rather mechanical KNF, now that style(9) clarified on the status
of sizeof() as a function-like unary operator; use parenthesēs around
sizeof and return args consistently too
2009-06-08 20:06:50 +00:00
tg 548a415fa9 these are expected failures if -DMKSH_ASSUME_UTF8=0 that cannot be
expressed as check.pl categories
2009-06-07 22:43:46 +00:00
tg 848e237b76 new feature: -DMKSH_ASSUME_UTF8=0 assumes utf-8 is *not* set and skips
environment inspection; useful for initrd and the likes
2009-06-07 22:28:05 +00:00
tg f4ed74a610 allow HAVE_REALPATH=x in the environment if MKSH_SMALL to enable the
feature if possible, like HAVE_MKNOD does. same for revoke.
2009-06-07 22:26:00 +00:00
tg 72c8f3c70d MKSH_BINSHREDUCED is independent from MKSH_SMALL, has been for a while
this is to accomodate e.g. Debian
2009-06-07 22:21:39 +00:00
tg d5d8fb0d40 naaina provided me with a patch from Sean Boudreau, QNX Software Systems,
which I applied slightly tuned: QNX 6.4.2 ed(1) is said to fix the issues
that made it unusable by our regression test suite
2009-06-07 14:50:58 +00:00
tg 1794287528 fix event-subst-* regression tests on Cygwin, which insists on a shebang 2009-06-06 14:23:17 +00:00
tg 63c56000f7 sync with oksh:
Revision 1.129: [7]download - view: [8]text, [9]markup, [10]annotated - [11]select for diffs
   Thu May 28 06:09:06 2009 UTC (3 days, 11 hours ago) by jmc
   Branches: [12]MAIN
   CVS tags: [13]HEAD
   Diff to: previous 1.128: [14]preferred, [15]coloured
   Changes since revision 1.128: +6 -6 lines
fix missing bracket by slightly rewriting; from Alan R. S. Bueno
2009-05-31 17:41:09 +00:00
tg 804fe16118 add base64 decoder and encoder in mksh 2009-05-31 17:17:33 +00:00
tg 16c47bbe91 fix bug exhibited by t0000-basic.sh introduced in R38 shortly before the
release: sometimes, a “cd -P” would cause memory corruption because lalloc
internal data was overwritten due to accidentally losing a “continue;”
2009-05-31 15:10:07 +00:00
tg cda3cc93f1 From André “naaina” Wösten via IRC:
QNX 6.4 is out, which has a different waitfor() in <libutil.h>, which
we by definition of __NO_EXT_QNX do not want to use. They are in the
process of porting the NetBSD® pkgsrc® repository to it.

The /bin/ed situation hasn’t improved yet though.
2009-05-29 14:41:37 +00:00
tg da5dc48cd0 implement an extension that an interactive mode input line, when
starting with an ‘!’ exclamation mark at the beginning of a com-
mand (PS1 not PS2), shall have the same effect as the predefined
“r” alias, to be compatible with csh and GNU bash’s “!string” to
«Execute last used command starting with string» – documentation
and feature request provided by wbx@ (Waldemar Brodkorb)
2009-05-27 19:52:38 +00:00
tg b90007d784 • Build.sh, strlcpy.c: gcc-current conversion &c. warnings cleanup
• histrap.c, lex.c, misc.c: get average stack frame size to <= 768 bytes
• check.t, sh.h: bump version
2009-05-27 09:58:24 +00:00
tg 9179c10119 pgas mentioned ksh93 does [[ $foo ]] (ipv forced [[ -n $foo ]])
and it actually REDUCES code size to allow it as well; mention
in the manpage that it’s merely unportable (and of course exe-
cution time differs); sync clog
2009-05-21 14:28:35 +00:00
tg b051f52dd4 we’re getting closer, but even a jobless mksh behaves the same 2009-05-20 10:10:35 +00:00
tg ae8d54284a commit Syllable-related improvement: simplify p_time 2009-05-20 10:10:02 +00:00
tg 361dee04f3 laffer1 agreed they will need -DMKSH_MIDNIGHTBSD01ASH_COMPAT in the
short term, but only for /bin/sh – thus recommend to also define
-DMKSH_BINSHREDUCED and make it dependent on FPOSIX
2009-05-16 21:00:52 +00:00
tg 8a2557f846 pcc cought a bad programming idiom I accidentally used
(without realising that it’s a macro expansion, that is)
2009-05-16 19:34:07 +00:00
tg 6744d2be1b provide upstream version 2009-05-16 18:57:54 +00:00
tg b6ce748064 • remove “#if 0” and “#ifdef notdef” style old debugging code
• expose “#ifdef MKSH_MIDNIGHTBSD01ASH_COMPAT” just in case they decide to
  require it and show it in the ksh version automatically
• sync the use of non-ASCII characters over files (unification)
2009-05-16 18:40:09 +00:00
tg cde2f02986 apply most of OpenBSD’s
│ Fix usage string for mknod builtin.
but don’t do a binary change as it doesn’t actually change anything

XXX fix all these usages anyway
XXX cd: cd: /home/tg/... - No such file or directory
XXX /bin/mksh: mknod: usage: mknod [-m mode] name [b | c] major minor
XXX /bin/mksh: mknod: mknod: No such file or directory
XXX etc. – but find out what POSuX demands ☹
2009-05-16 17:33:10 +00:00
tg b145ca5c9f • sync distrib/special/mksh/Makefile with bin/mksh/Build.sh and
fix the regression test’s results while here, which have been
  broken since cid 10049D9BE5254CE65B8
• get rid of separate copyright file which was intended for De-
  bian; track down commits in all files of oksh-mirbsd and mksh
  to get correct copyright years per-file, as is BSD custom
2009-05-16 16:59:42 +00:00
tg 7641ea6d07 optimise the “regression test” ☺ 2009-05-16 16:03:41 +00:00
tg cc783807d3 this began as a one-word change to the spec (manpage): that
${foo:1:2} operates on characters ipv bytes – which means:
‣ set +U: octets
‣ set -U: MirOS OPTU-8 characters

for consistency I also adapted ${#stringname} to deliver the
length in characters ipv bytes; more may follow; for example
I’d like a way to expose the string width.

you can already get the MirOS OPTU-16 of a character in the
WTF-8 (「set -U」) mode with something like
│ typeset -Uui16 -Z7 x=1#${stringname:position:1}
which will correctly use the PUA EF80‥EFFF mapping for octets.

due to this being an incompatible change, bump to R38

also change the unicode-hexdump sample regression test and
add two news for ${x:1:2} and ${#x} checks in A/W mode ☺
2009-05-16 15:53:02 +00:00
tg 8a7223d4cd split utf_ptradjx into utf_ptradj function (to save space) and
self-assignment macro; remove some uses of the macro in favour
of foo += utf_ptradj(foo)
2009-05-16 15:09:07 +00:00
tg 36f737f5cb bind new search-history-{up,down} to ANSI PgUp and PgDn keys
“because we can”
2009-05-16 14:45:40 +00:00
tg e7c565b2aa document currently bound ANSI cursor keys (↑↓←→ Home End Del) 2009-05-16 14:44:37 +00:00
tg 1535151525 fix typo 2009-05-16 14:34:58 +00:00
tg 2ebd816d63 bind new search-history-{up,down} to ANSI PgUp and PgDn keys
“because we can”
2009-05-16 14:34:57 +00:00
tg 747cc12184 Add search-history-up and search-history-down keybindings (both unbound
by default) to the Emacs command line editing mode; patch originally by
James Butler <sweetnavelorange@gmail.com> but slightly modified

10x
2009-05-16 14:19:23 +00:00
tg eb3f3d584f move pdksh and contributor dedication into TFM, preparation for things
to come
2009-05-16 14:17:39 +00:00
tg 1e6f3605b5 sync rcsid with openbsd; we did it in misc.c,v 1.95 already
what they kludged in now
2009-04-22 16:46:11 +00:00