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
tg
f6d937cc67
also recognise ksh93 compiled binaries and LZIP compressed files
2015-12-31 12:58:43 +00:00
KO Myung-Hun
780f220e23
Merge remote-tracking branch 'mksh/master'
...
Conflicts:
check.t
exec.c
sh.h
2015-10-11 19:42:38 +09:00
tg
cef386fb60
make “source” into a built-in command (keepasn, to match ksh93 and “dot”);
...
remove the “stop” alias and drop old Android and OS/2 hacks and auto-unalias
2015-10-09 21:36:59 +00:00
tg
fc48729336
tweak some iop/conservative_fds-related things I picked up while thinking lksh
2015-10-09 19:29:50 +00:00
tg
af35e9a6de
revert most of commitid 3ec342c92b3a8874 and fixup the rest;
...
this should bring us closer to POSIX again
2015-10-09 17:48:53 +00:00
tg
3fc8b5eb94
partial oksh sync, up to commit 80be547da108d5c241ae068290ca3e331446aa41?
2015-10-09 16:11:19 +00:00
tg
59e7366036
a bit more careful, even if probably unnecessary
2015-10-09 15:28:20 +00:00
KO Myung-Hun
bd9de444e3
Merge remote-tracking branch 'mksh/master'
2015-09-12 12:50:57 +09:00
tg
ed5cb56849
replace the code related to << changes and <<< with cleaner code,
...
fixing a few bugs also (including new testcases, except x=<< issue)
2015-09-06 19:47:01 +00: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
tg
719778193a
add missing colon to two error msgs (no effect on dedup)
2015-09-05 17:20:19 +00:00
KO Myung-Hun
4c61aeebe5
Use upstream style macro/function names
...
modified: edit.c
modified: eval.c
modified: exec.c
modified: main.c
modified: misc.c
modified: sh.h
2015-07-21 16:30:47 +09:00
KO Myung-Hun
834349f3be
Merge remote-tracking branch 'mksh/master'
...
Conflicts:
Build.sh
check.pl
check.t
edit.c
emacsfn.h
exec.c
funcs.c
main.c
misc.c
sh.h
var.c
2015-07-21 16:30:46 +09:00
tg
ba8a6e9461
merge OS/2 style PATH (absolute with drive letters, ‘;’ as separator)
...
From: KO Myung-Hun <komh@chollian.net>
2015-07-10 19:36:38 +00:00
tg
edf76ec8e6
harden the crlf vs lf tests even more; use binary mode explicitly on OS/2
2015-07-09 20:52:43 +00:00
tg
dcd8b6389b
apply the new cat hack to printf, too, to prefer it over the builtin
2015-07-09 20:20:45 +00:00
tg
d034be7a84
more mksh-os2 inspired hackery
2015-07-09 19:59:14 +00:00
tg
950827394b
more easy OS/2 fixes
...
From: KO Myung-Hun <komh@chollian.net>
2015-07-09 19:46:43 +00:00
KO Myung-Hun
65d8ad9dae
Merge remote-tracking branch 'mksh/master'
2015-07-08 19:31:55 +09:00
tg
f463d9da76
• revert the cat hack for realpath and rename
...
‣ I was convinced by several that more magic is never the solution
• fix a comment: function cat already had precedence
• change cat loader to look for existence, FPATH included, before
ditching the builtin; note that in manpage
2015-07-06 17:48:37 +00:00
tg
b9a8fdf905
implement cat thing for realpath and rename too: if flag, call external
2015-07-05 15:45:18 +00:00
tg
62e27c3e07
simplify print_columns func argument: no need to return the first arg any more
2015-07-05 14:43:08 +00:00
KO Myung-Hun
01648d4495
scriptexec: cosmetic
2015-06-11 22:44:00 +09:00
KO Myung-Hun
df2cf83f8b
scriptexec: preserve original shell/interpreter path
...
For example,
When failing to execute the script which starts with the above line,
an error message does not contain information for /path/to/name.
Instead, it contains only name. In addition, if /path/to/dir/, an error
message contains empty string for a name of a failed script.
2015-06-11 22:16:17 +09:00
KO Myung-Hun
b27e10a32e
scriptexec: try to use shell/interpreter name as well on OS/2
...
If specified path does not exist, try to use shell/interpreter name
without directory.
On OS/2, directory structures of distribution is quite different. And
Some scripts have hard coded shell/interpreter. To overcome this, allow
to use shell/interpreter name if specified path does not exist.
2015-06-11 16:16:07 +09:00
KO Myung-Hun
89324074c4
Prepend /@unixroot to rooted paths on OS/2
...
$UNIXROOT is a root directory of FHS on OS/2. /@unixroot is replaced by
$UNIXROOT at runtime.
2015-06-03 13:00:49 +09:00
KO Myung-Hun
a32d1d70bf
Support .cmd and .bat on OS/2
2015-06-03 13:00:44 +09:00
KO Myung-Hun
148c019595
MZ magic is supported on OS/2
2015-06-03 13:00:44 +09:00
KO Myung-Hun
759b6ec59f
Consider OS/2-style path
...
OS/2 uses 'x:' as a drive prefix and '\' as a directory separator.
2015-06-03 13:00:43 +09:00
KO Myung-Hun
9b30ce1a6d
Support extproc on OS/2
...
extproc is similar to like #! on OS/2.
2015-06-03 13:00:42 +09:00
KO Myung-Hun
5127457319
Read in text mode, write in binary mode on OS/2
...
This enables to convert CR+LF to LF when reading, but disables to
convert LF to CR+LF when writing.
Instead, however, CR+LF are not passed into mksh as is.
2015-06-03 13:00:41 +09:00
KO Myung-Hun
a3fdbc6802
Make all the files executable on OS/2
...
On OS/2, an executable status is determined by an extension such as .exe
not real executable mode.
Script files without executable extensions such as .exe, cannot be
executed.
2015-06-03 13:00:41 +09:00
KO Myung-Hun
5ed2481df2
Try to append executable suffixes if not having extension on OS/2
2015-06-03 13:00:40 +09:00
KO Myung-Hun
8f633da789
Path separator is ; on OS/2
2015-06-03 13:00:40 +09:00
tg
c3efd2abb2
use already-existing ksh_isdash helper macro
2015-04-29 18:32:44 +00:00
tg
b7332de28c
a bit oksh-inspired getn return value checking, plus some code optimisation
2015-04-19 14:40:09 +00:00
tg
a1ba509bb9
oksh RCSID sync: we use mksh getn() instead of OS strtonum() which is just as safe (audited right now)
2015-04-19 14:23:26 +00:00
tg
cad9bc86d3
Implement the “FKSH functions have local scope for shell options” feature
...
for mksh but not lksh; bump to R51-alpha.
While here, tweak build scripts a bit, fixup MirBSD-specific Makefile
things, remove part of a comment that’s uninteresting.
2015-04-11 23:28:21 +00:00
tg
e1cda74d04
SECURITY: fix integer overflows related to file descriptor parsing
...
bug initially found by Pawel Wylecial (LP#1440685)
additional bug found and suggested fix by enh (elliott hughes)
This commit also renames struct ioword.flag to ioflag to disambiguate
it from other members named “flag”, changes it to an unsigned type,
and packs ioflag and unit into shorts each, to make the struct smaller
(aligned even: 16 bytes on 32-bit systems) and reviews some of the
code involved in fd handling, though there wasn’t much to be found.
2015-04-11 22:03:32 +00:00
tg
07898d8a45
only lksh now implies unalias for a POSIX function definition (used e.g. in Debian sysvinit scripts that use a “stop” function)
2015-03-20 23:37:55 +00:00
tg
73082b9292
• fixup here document expansion (regression wrt. pdksh 5.2.14)
...
• adjust testsuite (and write tons of new tests) after today’s commits
2015-02-19 22:26:50 +00:00
tg
1248a0a521
basically unbreak use of $*/$@ in here documents
...
a bit funny:
with NUL IFS, $* behaves like dash ('ab') and $@ like bash/ksh93 ('a b')
with WS or NWS IFS, all shells behave alike though
2015-02-19 22:00:03 +00:00
tg
ab683420df
fix use of $*/$@ in scalar context in [[ … ]] and case; spotted by Stéphane Chazelas
2015-02-19 21:58:19 +00:00
tg
f6f49a119b
add getopts for exec (unbreaks “exec -- /bin/ls”) and steal -a and -c from ksh93
2015-02-06 10:56:49 +00:00
tg
b94b2e363a
stop (ab)using the OS symbolic constant EOF, always use -1; plus misc fixes
2015-02-06 10:09:07 +00:00
tg
f235766a3d
int → bool
2015-02-06 09:42:46 +00:00
tg
3be80b75ed
remove dead code: this can no longer happen since exec.c,v 1.67
2015-02-06 09:42:08 +00:00