Commit Graph

128 Commits

Author SHA1 Message Date
tg df8681e880 fixup by regenerating with new eawparse which matches what I submitted to
https://sourceware.org/bugzilla/show_bug.cgi?id=21750 even if only FF00
actually changed due to the algorithms in use
2017-08-07 21:38:55 +00:00
tg ac262e5395 Unicode 10.0.0 2017-07-08 15:11:52 +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 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 1080008a8f eliminate legacy macros 2017-04-27 19:33:53 +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 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
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 5ee8ba10b3 fix lazy evaluation with side effects; spotted by ormaaj via IRC 2016-11-07 16:58:48 +00:00
tg a838564cec Unicode 9.0.0 (code and data part; FixedMisc font tbd) 2016-09-01 12:55:21 +00:00
KO Myung-Hun d4be6d4358 Merge tag 'mksh-R53' into HEAD
Conflicts:
    exec.c
2016-08-13 15:05:49 +09:00
tg 92370ec355 shave off 12 bytes (with fixed gcc) by making the definitions more legible
(and dropping struct padding, tbh)
2016-07-27 00:55:27 +00:00
tg 2364bb5f22 use ^< and ^> for ROL and ROR in R53, schedule >>> as SAR for R54
cf. http://david.tribble.com/text/c0xrot.htm
2016-07-25 20:41:23 +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
KO Myung-Hun e8966076c8 Merge remote-tracking branch 'mksh/master' 2016-05-06 17:12:52 +09:00
tg 92833fc6ce fix utf_widthadj/utf_skipcols handling for the remaining cases I can spot 2016-05-05 22:56:15 +00:00
tg 152eee2085 handle combining characters at the end of the string correctly 2016-05-05 21:33:46 +00:00
KO Myung-Hun 68f6e899ef Merge tag 'mksh-R52c' 2016-03-05 14:59:34 +09:00
tg 7c93759f66 fix invalid read for ksh93-style base-1 integers
(valgrind; reported by fmunozs via IRC, thanks!)
2016-03-01 18:29:38 +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
KO Myung-Hun 6eb125c18a Merge commit '91ae6ad199035b1cf' 2016-01-24 16:36:38 +09:00
tg 000580ca8f fix buffer overrun (LP#1533394) 2016-01-14 21:17:50 +00:00
KO Myung-Hun 0c41f2fdc8 Merge remote-tracking branch 'mksh/master' 2015-12-13 17:59:43 +09:00
tg 124e6693e9 janitorial work 2015-11-29 17:05:02 +00:00
KO Myung-Hun 788fdcd188 Merge remote-tracking branch 'mksh/master' 2015-10-26 11:24:15 +09:00
tg 1a4f644d6e save ~1½K from the bootfloppy by reusing MirBSD libkern wcwidth(3)
but don’t bother for this for the regular /bin/mksh either
to keep the generic code path tested well
2015-10-24 19:45:23 +00:00
KO Myung-Hun bd9de444e3 Merge remote-tracking branch 'mksh/master' 2015-09-12 12:50:57 +09:00
tg 4adcfe8b58 oksh sync, simplify *all* if(x)free(x); constructs, simplify x_push() and sync boilerplate while here 2015-09-05 19:19:12 +00:00
KO Myung-Hun a03cf65602 Consider executable extensions in case of some test commands on OS/2
-r, -w, -x, -a, -e, -f.
2015-06-03 13:00:42 +09:00
tg f66c194f29 oksh sync RCSIDs only:
• expr.c long done already
• mksh.1 does not apply to us (no character classes)
2014-12-15 23:26:36 +00:00
tg 9eed448a96 Unicode 7.0.0 2014-06-24 19:53:19 +00:00
tg 89e774fd7e • fix ${12345678901234567890} segfault (OOB access / integer overflow)
‣ not like oksh did, but using mksh’s built-in features
• handle suggested __pure additions
• revert cid 1004F7F096867C83CF0
  ‣ always use our wcwidth code
  ‣ only use our strlcpy code if none found
• fix a couple of gcc-snapshot and clang/scan-build warnings
• mksh R49~rc1
2014-01-05 21:57:29 +00:00
tg 2f7eec765d merge oksh’s “ctype cleanups” commit
(not much of it applies since we don’t use the OS’ table-based lookup)
2014-01-05 19:11:46 +00:00
tg 328cbf510c Unicode 6.3.0 2013-11-30 23:20:04 +00:00
tg 3bc3e8665a fix postun in not evaluated side of e.g. ternary operator (LP#1187729) 2013-07-21 18:38:56 +00:00
tg 49d1ebfb71 Replace wcwidth code by mine based on Unicode 6.2.0 2013-05-31 23:27:14 +00:00
tg 75a4809a3a fix remaining signed int nonsense I am aware of 2013-04-26 19:10:58 +00:00
tg 1df3efdb86 another intermediate step/commit to get arithmetics right:
do the correct operations for comparisons (just keep using the
signed/unsigned switch from bivui for them), division (by working
on absolutes and adding the sign at the end), modulo (stupidly by
divising in signed, multiplying and subtracting, to get the sign
of the result right)

also adds rotation

XXX to check: do we need to AND before assigning the result in division?
2013-04-14 13:36:53 +00:00
tg 7cce9de0bc one can’t cast an unsigned int to a signed int portably either, if the value
is larger than the positive range of the latter (implementation-defined), so
avoid them in all explicit cases and rearrange stuff and check for it

(I’m gonna have to revise lots more code…)
2013-04-01 02:37:53 +00:00
tg fb3555d7f5 got an SAR, thanks to dalias on IRC 2013-04-01 02:28:35 +00:00
tg e1a4c3ed28 do use val.u on the RHS of a shift 2013-04-01 01:29:47 +00:00
tg 0f417614dd ugh, signed >> on negative values is implementation-defined
(but, at least, not undefined, and usually right; regress-test for it)
2013-04-01 01:16:37 +00:00
tg d96c733069 looks like multiplication is also the same between signed and unsigned 2013-04-01 01:02:09 +00:00
tg 6a745a01fa begin using unsigned arithmetics internally as much as possible
(i.e. where signedness doesn’t matter, given -fwrapv) and note
where there’s work to do; note future improvements and additions;
optimise a little

mostly untested
2013-03-31 18:33:13 +00:00
tg 24b81b5969 RCSID-only sync: oksh found out about idivwrapv 2013-03-29 16:54:05 +00:00
tg 12f0ff60d2 prevent more access to invalid memories (Debian #700604) 2013-02-15 18:36:48 +00:00