Commit Graph

885 Commits

Author SHA1 Message Date
tg 2231ff566d commit the optimisation result from the new fast character classes 2017-04-28 00:38:33 +00:00
tg 9db3cb57b9 allow : and [ in alias names (but forbid [[ explicitly)
to make 'enable' completely work again
2017-04-27 23:33:22 +00:00
tg 13e91621ca fixup the remaining issues and last optimisations 2017-04-27 23:12:49 +00:00
tg d54d4aab50 batch of optimisations 2017-04-27 20:22:28 +00:00
tg 91a3d6751e fix C_LEX1 which does STILL N̲O̲T̲ include the NUL… 2017-04-27 19:19:05 +00:00
tg b228c59895 convert to the new fast character classes 2017-04-27 19:16:10 +00:00
tg 3dff460cde prepare the new fast character classes, not live yet: need sanity check
unfortunately we need at least 21 or so, maybe 19, classes, so sizing
things down to short is not possible; we can splurge with 32 bit thus
2017-04-22 00:07:10 +00:00
tg d3be19ac69 now actually do comparisons for sorting ASCIIbetically 2017-04-21 20:06:06 +00:00
tg e18a509a80 make ord() result unsigned int; add asc() which is:
• not designed to be emitted, only used in comparisons with
  other asc() results
• on EBCDIC platforms, the mapping of an EBCDIC octet to their
  corresponding ASCII or Unicode/UCS-4 codepoint or, if there
  is no mapping, a distinct value above all valid Unicode codepoints
• on nōn-EBCDIC platforms, just the identity mapping of the input
  octet into their ord() value

Intended use are ASCII-ish character ops, including ranges (“A-Z”),
mapping from those to the corresponding digit offset, and sorting
of things in an ASCIIbetical way
2017-04-21 19:50:09 +00:00
tg c35a5db0ac restore ‘.’ as allowed char in alias names 2017-04-20 20:50:14 +00:00
tg cb7280db1d amend MAGIC comment 2017-04-20 16:50:48 +00:00
tg 2699a0686e do not apply alias name restrictions to directories or “hash”
reported by Seb <sbb@tuxfamily.org>
2017-04-17 19:51:47 +00:00
tg 833cb27f5c add test -v, initially from Martijn Dekker 2017-04-12 17:38:46 +00:00
tg fae945962b allow 'eval break', from Martijn Dekker
also, more string pooling, while here
2017-04-08 01:07:18 +00:00
tg cadc884008 put the hyphen-minus back into the allowed alias name characters, for
Steffen Nurpmeso <steffen@sdaoden.eu>, except disallow it at the start
2017-04-06 19:02:07 +00:00
tg 3909a42540 fix reentrancy of 'typeset -f' output in the face of aliases; also,
move alias handling for COMSUBs and friends to parse time by request
of Martijn Dekker (and for consistency with function definitions)
2017-04-06 01:59:58 +00:00
tg e00f693cba limit alias characters to what POSIX requires 2017-04-06 00:53:35 +00:00
tg bcde17a8fc streamline some error messages 2017-04-06 00:41:42 +00:00
tg fa5cfa12ed string pooling, and more consistent look for error messages 2017-04-02 16:47:43 +00:00
tg 718d397fff merge mksh-os2 by KO Myung-Hun <komh@chollian.net> from https://github.com/komh/mksh-os2 2017-04-02 15:00:45 +00:00
mirabilos a6619d1ef2 use new MKSH_WITH_TEXTMODE for several of the #ifdefs 2017-04-02 16:41:01 +02:00
mirabilos 7fb9d283c5 Merge mksh CVS HEAD 2017-04-02 16:32:16 +02:00
tg 8bf6cad8bc introduce the -T flag to set TEXTMODE (ASCII CR+LF newline support) 2017-04-02 14:14:08 +00:00
tg d68e69bd59 split path-specific ('C:\FOO' instead of '/foo') stuff into MKSH_DOSPATH:
• backslashes as directory separators
• semicolon as $PATH separator
• drive letters are absolute paths
2017-04-02 13:08:07 +00:00
tg 7529e350cf small character classes overhaul:
• make fast character classes even faster by removing the C_SUBOP2 hack
  in favour of a separate seldom-used ksh_issubop2 macro (which also
  makes ctype() side-effect-safe) which is a slower class (no change there)
• optimise cases of ksh_isalphx followed by a ksh_isalnux loop
  (used parsing variable names)
• remove a misleading comment in initctypes() about \0 from pdksh
• rename C_ALPHA to C_ALPHX to make it more clear the underscore is included
• sprinkle a few ord() in there
• add new ksh_isalpha() which tests for [A-Za-z] (slow character class)
• there is no '_:\' drive on OS/2 (which inspired the whole changeset)
2017-03-26 00:10:26 +00:00
mirabilos e216226f68 mostly more KNF 2017-03-26 00:18:21 +01:00
KO Myung-Hun c19b8b104c Merge remote-tracking branch 'mksh/master' 2017-03-22 17:50:23 +09:00
tg 034d0c0269 fixup “\builtin” on OS/2; thanks komh for spotting this 2017-03-22 00:20:53 +00:00
tg 9466b49fe8 add standard variable PATHSEP, for better and easier OS/2 support 2017-03-19 22:31:29 +00:00
tg 5b63e5dcb6 implement “typeset -g”, From: Martijn Dekker <martijn@inlv.org>
also deprecate “global”; thanks!
2017-03-17 22:45:53 +00:00
tg b531baa7fd add a “\builtin” builtin, make it forward assignments, fix some bugs
related to that:
• while AT&T ksh may do it, POSIX says nothing about allowing
  declaration commands only without vars and redirections, and
  “without vars” especially seems against which commands they are
• fix relationship between forwarders and real declaration commands
• clean up c_builtin vs shcomexec mess

Also, re-run “make repool” with a fixed src/scripts/stringpool.sh,v 1.3
2017-03-12 02:04:15 +00:00
tg 2584cd0634 fixup relation between lksh and mksh (somewhat minimal delta) 2017-02-18 02:33:15 +00:00
tg 7b02f1ec8d in ${foo=bar}, “bar” must be scalar context; spotted by Martijn Dekker 2017-02-17 22:40:13 +00:00
KO Myung-Hun cc49df380e fix mksh_sdirsep() and simplify mksh_vdirsep() on OS/2
mksh_sdirsep() returned a position of a more far directory separator
if '/' and '\' were mixed.

And mksh_sdirsep() returned a position of ':' even if a directory
separator follows. For example, in case of 'x:/', the position of
'/' should be returned not ':'.

mksh_vdirsep() were simplified with mksh_sdirsep().
2016-11-12 15:23:24 +09:00
KO Myung-Hun a2e965cad3 Merge remote-tracking branch 'mksh/master'
Conflicts:
    Makefile
    edit.c
    eval.c
    exec.c
    main.c
    misc.c
    sh.h
    var.c
2016-11-12 13:22:58 +09:00
tg 7b4bee7e58 collective R54 release preparation multi-merger:
install both lksh and mksh manpages from Build.sh (Martijn Dekker)
spelling fixes (Larry Hynes)
manpage improvements (Martijn Dekker)
initial port to Harvey-OS’ APEX (Ronald G. Minnich, Elbing Miss, Álvaro Jurado)
more from komh’s OS/2 port (KO Myung-Hun)
2016-11-11 23:31:39 +00:00
tg 5ee8ba10b3 fix lazy evaluation with side effects; spotted by ormaaj via IRC 2016-11-07 16:58:48 +00:00
tg 56bdf24e54 fix error propagation in TAND/TOR constructs, noted by Martijn Dekker
still a bit unsure about the whole XERROK and *xerrok stuff, but…
it seems to work
2016-10-02 22:21:47 +00:00
tg d18f9133c8 fix English (thanks to Andreas Buschka); TIL:
• to start ⇒ a start
• to begin ⇒ a beginning
2016-09-01 12:59:12 +00:00
tg e5e3fb3fc7 outstanding bumps 2016-08-25 16:21:34 +00:00
KO Myung-Hun ef42532640 Merge tag 'mksh-R53a' into HEAD 2016-08-13 15:11:41 +09:00
KO Myung-Hun d4be6d4358 Merge tag 'mksh-R53' into HEAD
Conflicts:
    exec.c
2016-08-13 15:05:49 +09:00
tg 879c6a0911 fix refactoro, spotted by Natureshadow; add (working) testsuite for all operators 2016-08-12 16:48:05 +00:00
tg 2db6d0a08c bump, required by XTaran 2016-08-10 18:20:18 +00:00
tg f26cf0562b fixup a bad OpenBSD reaction on a bug afl showed:
set source to NULL only if the memory backing source is actually reclaimed;
fixes segfault due to NULL(+24) pointer dereference reported by Score_Under
(simplified testcase added; thanks!)
2016-08-04 20:51:35 +00:00
tg 757e25fb21 implement $KSH_MATCH and, to make it usable, ${foo@/bar/baz};
add a real-life example (for slagtc’s programmable tab completion)
to the manpage
2016-08-01 21:38:07 +00:00
tg e5a54ebb6b fix the occasional issue printing \xFF from a string 2016-08-01 20:23:15 +00:00
tg f21d6a3ffd fix (POSIX) errorlevel of ‘.’ when sourced file has no commands; issue discovered by Natureshadow 2016-07-28 21:39:19 +00:00
tg dd281c52ec defer to external rename(1) too 2016-07-26 21:50:46 +00:00
tg f9d131133e remove fd>9 support in favour of upcoming named file descriptors; bump 2016-07-25 21:05:25 +00:00