Commit Graph

251 Commits

Author SHA1 Message Date
tg cc59adb1f5 write ord’ed into c 2018-01-14 01:29:47 +00:00
tg 609f5c2256 plug the first couple of ctype bugs 2018-01-14 00:22:30 +00:00
tg c763e7b0e9 revert the CORD debugging aid
(introduced so that ORD could eval its args twice in !DEBUG)
2018-01-14 00:03:05 +00:00
tg dde8500a24 some ord() debugging; CORD for case, ORD evaluates twice, for debugging 2018-01-13 23:55:15 +00:00
tg 7cbce8f98e quell a Fink compiler warning; not entirely correct but no harm done either 2017-08-28 23:27:51 +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 cc725e67ca switch EBCDIC to “nega-UTF8” 2017-05-05 20:36:03 +00:00
tg 46865d7fc8 move the constants to an EBCDIC-friendly range 2017-05-03 15:36:12 +00:00
tg c4bcfd944e move magic constants into definitions 2017-05-03 15:33:16 +00:00
tg 4c5d033f75 sprinkle a few ord() and add an indicator of why some code fails on EBCDIC 2017-05-03 14:51:25 +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 2231ff566d commit the optimisation result from the new fast character classes 2017-04-28 00:38:33 +00:00
tg 13e91621ca fixup the remaining issues and last optimisations 2017-04-27 23:12:49 +00:00
tg 1080008a8f eliminate legacy macros 2017-04-27 19:33:53 +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 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 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 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
mirabilos 859746b30b fix \r followed by something else than \n or EOF 2017-03-26 00:09:46 +01:00
KO Myung-Hun c19b8b104c Merge remote-tracking branch 'mksh/master' 2017-03-22 17:50:23 +09:00
tg bc4397e28a fixup tilde expansion comments; revert a few bogus dirsep changes
cf. <Pine.BSM.4.64L.1703112129500.29506@herc.mirbsd.org>
2017-03-11 22:49:56 +00:00
tg 7b02f1ec8d in ${foo=bar}, “bar” must be scalar context; spotted by Martijn Dekker 2017-02-17 22:40:13 +00:00
tg ca6529e0a2 oops… 2017-02-17 21:15:55 +00:00
tg 21f70afb26 make ${var@x} with unknown x fail; spotted by izabera, thanks 2017-02-17 20:52:15 +00:00
KO Myung-Hun 87cea30045 eval: fix typo
modified:   eval.c
2017-01-19 16:36:18 +09:00
KO Myung-Hun e0355b78a9 eval: trim CR+LF in backtick('') and $()
modified:   eval.c
2017-01-10 17:29:41 +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 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 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 c3e794c4d0 rework string pooling; disable our own (rely on compiler’s)…
• if HAVE_STRING_POOLING is set to 1
• if HAVE_STRING_POOLING is set to 2 and not GCC < 4 is used
• if HAVE_STRING_POOLING is not set to 0 and LLVM or GCC >= 4 is used

Closes: LP#1580348
2016-07-25 00:04:48 +00:00
tg e0e63c65e6 fix issues with home directory replacement, from Torsten Sillke:
• if $PWD = ${HOME}foo, no longer show as ~foo in PS1
• simplify ~, ~+, and ~- exactly as $PWD is upon shell entry
  (fixes HOME=/home/./foo but PWD=/home/foo)
2016-07-24 23:05:52 +00:00
tg a41a62dad7 efficient $(<<<foo) and $(<<EOF … ) implementation, requested by izabera 2016-06-26 00:44:59 +00:00
tg 262ae5a436 fix most of the ambiguous ${[prefix] var [op [word]]} corner cases
prodded by izabera and carstenh; resolution is:
• you can’t trim a vector in mksh, still (consider ${@:-1})
• future POSIX will require non-empty “word” for most “op”s
• dissolve in order of standard → extension
• dissolve to prefer “op” over “prefix” where still necessary, mostly
2016-06-25 23:55:00 +00:00
tg 3d130b606a give C_VAR1 precedence over display variable name; izabera pointed out,
rightfully, that, in POSIX shell, ${!#} is defined, and ${!#123} should work
2016-05-05 22:45:58 +00:00
tg b6e438037f collapse uselessly nested if 2016-05-05 22:19:04 +00:00
tg 9c1568a8cc fix trimming with ? on $* and $@; missed by Todd Miller in r2.2 in ncvs
where it was fixed for ${foo[@]} and ${foo[*]}
2016-02-26 19:05:21 +00:00
tg a3c28ebd67 plug a few display problems with special parameter name expansions
reported by Stéphane Chazelas
2016-02-26 18:48:14 +00:00
tg c8da180d60 fix substitution error message 2016-02-26 18:05:10 +00:00
tg 08e1c6a9ea ADELIM can be ‘}’ too, not just ‘/’, in code that checks for / vs. //
caught by new code after segfault report by bef0rd on IRC (thanks!)
2016-02-24 01:47:32 +00:00
tg 188691d285 save 200 bytes off .text by revisiting string pooling
also, forgotten version bump
2016-01-21 18:24:45 +00:00
tg 046d8e5b7a align with future POSIX on http://austingroupbugs.net/view.php?id=351
with accepted interpretation (*sigh*); merge VARASN|ARRAYVAR→CMDASN
2016-01-19 23:12:15 +00:00
tg 0141794c2e correctly handle nested ADELIM parsing: ADELIM doubles as CSUBST (LP#1453827) 2016-01-14 22:30:43 +00:00
tg 489fb7e845 further bring ${x/y/z} closer to GNU bash behaviour, we now only miss
recursive extglobs
2015-12-12 22:24:07 +00:00
tg 3b2ad0f9d9 fix ${*:+x} constructs; bug reported by carstenh via IRC 2015-12-12 20:38:56 +00:00