Commit Graph

902 Commits

Author SHA1 Message Date
tg
b903a5e66a make readonly idempotent; spotted by selk from Dragora 2017-07-26 23:02:28 +00:00
tg
868d982efb sprinkle tons more ord() around
this is really not funny… mksh-ng will use even more “unsigned only”
2017-05-05 22:53:32 +00:00
tg
86f45be109 nuke unused stuff 2017-05-01 19:44:16 +00:00
tg
e6395046df use strnul(); optimise 2017-04-29 22:04:31 +00:00
tg
f2de19c41f reimplement has_globbing() with proper bracket expression parsing,
and take ahead parsing collating symbols, equivalence classes and
character classes already (heck my first draft of this already did
better than GNU bash, ksh93 I still don’t grok its code at all)
2017-04-29 21:49:07 +00:00
tg
55d20ee9d2 instead of disabling, make it work 2017-04-29 14:20:24 +00:00
tg
bf0404e331 add C_ASCII (0x01 .. 0x7F: 7-bit ASCII except NUL) 2017-04-28 12:02:41 +00:00
tg
1e763eeb7b move three variables into common data, meaning .bss (hopefully) 2017-04-28 11:51:40 +00:00
tg
cb4bac0615 keep ksh_ctypes[] array keys in EBCDIC
we set $IFS massively less often than use ctype()
2017-04-28 11:31:53 +00:00
tg
5743c00a5b add -DMKSH_FAUX_EBCDIC to test the codepaths better
waking up to: Lanfear - Just Another Broken Shell
2017-04-28 11:13:49 +00:00
tg
dba2efa290 oops, ctypes are indexed by ASCII value even on EBCDIC systems 2017-04-28 03:51:14 +00:00
tg
d905bd16e1 rename asc() to asciibetical() to make clear it’s for POSIX ordering only
and switch remaining consumers, except the allowed one, to rtt2asc()
2017-04-28 03:46:50 +00:00
tg
fba6940ba4 control character madness, but more compiler-friendly 2017-04-28 03:28:19 +00:00
tg
2482c8b73d fill two complete round-trip maps EBCDIC <-> ASCII 2017-04-28 02:40:26 +00:00
tg
1289bc69fb apply most of the remaining parts of the EBCDIC patch, sans the CTRL() changes 2017-04-28 02:24:58 +00:00
tg
d658ad626b commit the EBCDIC run-time table conversion code, so it can be reviewed
XXX there’s still the issue of compile-time character conversion, and
XXX that runtime m̲u̲s̲t̲ use a compatible codepage, which we cannot check,
XXX and that we need the POSIX portable character set mapped, which we
XXX decide to not check (due to the above, mostly)
2017-04-28 01:15:51 +00:00
tg
8df7c0c94a BEL was, and Vi mode is, not EBCDIC-safe 2017-04-28 00:49:33 +00:00
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