Commit Graph

256 Commits

Author SHA1 Message Date
tg e6395046df use strnul(); optimise 2017-04-29 22:04:31 +00:00
tg 2231ff566d commit the optimisation result from the new fast character classes 2017-04-28 00:38:33 +00:00
tg 30cae62468 (very few) fixes and a couple of workarounds for Coverity 2017-04-12 16:46:23 +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 b446727285 do not use getenv() to allow users to change OS2_SHELL during the session 2017-04-02 15:02:40 +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 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
mirabilos e216226f68 mostly more KNF 2017-03-26 00:18:21 +01:00
mirabilos 62a5331aee no strcpy() allowed in BSD code 2017-03-26 00:05:25 +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 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 27cdd075c6 remove odd use of KEEPASN, I believe it really unnecessary now 2017-03-11 22:58:51 +00:00
KO Myung-Hun f814ccfb8f exec: remove the last / or \ when searching $PATH
For example, X:/ becomes to X://name. CMD.EXE is not tolerant of such
a style.

    modified:   exec.c
2016-12-23 15:41:30 +09:00
KO Myung-Hun bf88879b0d Revert "exec: prevent a command in a current dirctory from being executed"
This reverts commit 1b4d572b77.

An empty path is treated as a current directory in Unix, too.
2016-12-23 14:43:35 +09:00
KO Myung-Hun de671a4e1c Revert "exec: set ev to ENOENT properly"
This reverts commit 6739812ea6.
2016-12-23 14:43:20 +09:00
KO Myung-Hun 6739812ea6 exec: set ev to ENOENT properly
modified:   exec.c
2016-12-22 13:06:59 +09:00
KO Myung-Hun 1b4d572b77 exec: prevent a command in a current dirctory from being executed
A command in a current directory should be executed only if $PATH
contains the directory such as '.'.

This will improve the compatibility with Unix shell script and the
security.

    modified:   exec.c
2016-12-22 12:59:04 +09:00
KO Myung-Hun eb43e28996 Revert "exec: search commands in the current directory first on OS/2"
This reverts commit 89d461dd83.

To avoid the incompatibility with Unix shell scripts not expecting that
a current directory is searched first and the security problems, let a
user prepend "." to $PATH explicitly if needed.

    modified:   exec.c
2016-12-22 09:15:28 +09:00
KO Myung-Hun 89d461dd83 exec: search commands in the current directory first on OS/2
On OS/2, commands(executables) are searched in the current directory
before in $PATH.

    modified:   exec.c
2016-12-19 15:50:58 +09:00
KO Myung-Hun 224fd5aebe Merge remote-tracking branch 'mksh/master'
Conflicts:
    misc.c
2016-11-12 15:41:31 +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 7d387fd54e fix embarassing pasto and OS/2 UNC logic; thanks komh! 2016-11-12 03:54:48 +00: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 6c04e4a665 make print -c honour line separator 2016-11-11 21:13:25 +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 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
KO Myung-Hun 46ed22a2bb Preserve coding styles of upstream
modified:        exec.c
2016-08-26 08:42:29 +09:00
tg bb796ff785 simplify manpage and code; streamline manpage formatting and Satzzeichen 2016-08-24 20:40:00 +00:00
KO Myung-Hun d4be6d4358 Merge tag 'mksh-R53' into HEAD
Conflicts:
    exec.c
2016-08-13 15:05:49 +09: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 e8bbf79d8c invent builtin flags instead of special-casing cat and printf for prefer-external-over-builtin stuff 2016-07-24 23:10:04 +00:00
tg 5401a55a98 optimise away code for a case that’s almost unlikely to happen; fix pasto(?) 2016-07-24 23:07:19 +00:00
KO Myung-Hun 0d730e1ad9 Merge remote-tracking branch 'mksh/master' 2016-06-29 08:17:29 +09:00
tg a41a62dad7 efficient $(<<<foo) and $(<<EOF … ) implementation, requested by izabera 2016-06-26 00:44:59 +00:00
tg 97d1d5e4fe fix var=<< implementation 2016-06-26 00:09:35 +00:00
KO Myung-Hun e8966076c8 Merge remote-tracking branch 'mksh/master' 2016-05-06 17:12:52 +09:00
tg 83cde99aee fix redefining FKSH functions as !FKSH (e.g. the smores change) 2016-04-09 16:41:07 +00:00
KO Myung-Hun 68f6e899ef Merge tag 'mksh-R52c' 2016-03-05 14:59:34 +09:00
tg c2bdb1b9dd check not-begun heredocs at EOF earlier
izabera reported they were not caught with “set -n”
2016-03-01 18:30:05 +00:00
KO Myung-Hun 36ea6b5f88 Merge remote-tracking branch 'mksh/master' 2016-01-24 16:43:45 +09:00
KO Myung-Hun 6eb125c18a Merge commit '91ae6ad199035b1cf' 2016-01-24 16:36:38 +09: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 4059e105a2 fstat(2) after open(2) for set -C case when initial stat(2) was !S_ISREG
to fix race condition as suggested by jilles
2015-12-31 21:03:47 +00:00