Commit Graph

369 Commits

Author SHA1 Message Date
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 c7f9c5a201 const 2017-04-28 11:48:46 +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 8db6d22188 refactor 2017-04-27 23:18:05 +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 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 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 cad44b9f01 fix test operator comment descriptions 2017-04-12 17:46:29 +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 fa5cfa12ed string pooling, and more consistent look for error messages 2017-04-02 16:47:43 +00:00
tg ab976fd8d3 move c_typeset() to var.c so we have access to either array_index_calc() or innermost_refflag for 'typeset -p x[2]' 2017-04-02 15:51:20 +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 9d00cfc02b fix two small setmode()-related bugs 2017-04-02 16:42:44 +02:00
mirabilos a6619d1ef2 use new MKSH_WITH_TEXTMODE for several of the #ifdefs 2017-04-02 16:41:01 +02:00
KO Myung-Hun c19b8b104c Merge remote-tracking branch 'mksh/master' 2017-03-22 17:50:23 +09:00
tg e991806f2b fixup LINENO in eval and alias; patch and initial testcase
From: Martijn Dekker <martijn@inlv.org>
2017-03-22 00:20:43 +00:00
tg 06b2d53ea2 use \\builtin ipv \let] and \set internally 2017-03-19 20:59:29 +00:00
tg c3fe9d5fb5 Haiku-related ulimit overhaul:
• print ulimit -a with the flag, like most other shells do
• move ulimit-1 regression test to ulimit-2 and exclude on Haiku:
  it can only set the -n and -V limits AFAICT
• document that some OSes (here: Haiku) can only set the soft limits
  (so “ulimit -nS 1024” is okay but -S is required)
• check “ulimit -c 0”, which dot.mkshrc uses, everywhere
  (if it errors out, hack around it or stub it out with MKSH_NO_LIMITS)
2017-03-19 18:05: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 59219161fb document the declaration utility stuff and the new \builtin
also, make global a declaration utility
2017-03-12 02:31:02 +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 950df6491d add “\builtin” utility 2017-03-11 23:22:36 +00:00
tg ff72ba8399 make “builtin” and “wait” not special
(“\builtin” likely also doesn’t need it, as “command” isn’t)
2017-03-11 23:10:41 +00:00
tg 2584cd0634 fixup relation between lksh and mksh (somewhat minimal delta) 2017-02-18 02:33:15 +00:00
tg 18051b7e8a less assignments 2017-02-18 01:27:24 +00:00
tg 287507fb21 there’s no evidence for -e in any BSD echo (but in ksh93 print)
spotted by Jean Delvare <jdelvare@suse.de> and Werner Fink <werner@suse.de>
2017-02-17 22:28:26 +00:00
tg d9b0b71b1d fix broken indentation accidentally introduced in -r1.293
(after checking whether indeed indentation or braces are wrong)

spotted by Jean Delvare <jdelvare@suse.de> via mailing list, thanks!
2017-02-08 15:27:27 +00:00
KO Myung-Hun 20dbf6b45b Read in text mode in a needed place only
Converting CR+LF to LF in blocking_read() which is a underlying read
function, may affect to the functions which do not perform line-based
operation.

    modified:   funcs.c
    modified:   main.c
    modified:   misc.c
    modified:   os2.c
    modified:   shf.c
2016-12-19 08:27:06 +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 0ba220d2c4 gcc 6.2 warnings (stupid uninitialised that wasn't, plus FALLTHROUGH fixes) 2016-11-11 23:48:30 +00:00
tg 3aac3c30b5 return 128+SIGALRM if read with timeout timeouts, inspired by GNU bash 2016-11-11 22:17:09 +00:00
tg 6267ea36a4 fix print -cn 2016-11-11 21:37:35 +00:00
tg 6c04e4a665 make print -c honour line separator 2016-11-11 21:13:25 +00:00
tg 26689a7c81 just 'print -c' outputs not even a newline; plug a memleak while here 2016-11-11 20:53:15 +00:00
tg 5ba6be5837 put print_columns options into a helper struct, eases passing things around 2016-11-11 20:14:18 +00:00
tg e16b0b9d5b first implementation of “print -c” for columnising, currently hardcoded newlines 2016-11-11 19:59:39 +00:00
tg 6a9dae2144 implement print -N: set output word and line separator to NUL 2016-11-11 19:18:40 +00:00
tg 8c2eda2f0f implement print -l: change output word separator to newline 2016-11-11 19:12:52 +00:00
tg d4b81df050 goto keeps us from evaluating the loop condition twice in immediate succession
(and shaves off an indentation level)
2016-11-11 19:09:44 +00:00
tg 1c07e75fc0 implement: empty arg in print -A is input word separator 2016-11-11 19:02:26 +00:00
tg 4ed09871a9 refactor c_print into a loop 2016-11-11 18:50:09 +00:00
tg 4e855b1be2 pack local bools into a struct, for tighter stack packing 2016-11-11 18:44:32 +00:00
tg 61969809e4 read(2) and write(2) don’t EINTR for fast input (LP#1616692) 2016-08-25 16:21:14 +00:00