Commit Graph

2972 Commits

Author SHA1 Message Date
KO Myung-Hun 18ff277047 Write in binary mode through pipes
On kLIBC, a child inherits a translation mode of stdio/stdout/stderr
of a parent. So if setting stdio handles of a parent to text mode,
a child reads CR+LF as LF and write LF to CR+LF. Especially, LF to
CR+LF conversion causes many troubles in UNIX programs.

Instead, if a child inherts a child inherit a current translation mode,
where stdin is text mode, stdout and stderr are binary mode, a child
would write LF as is.

This is the way for OS/2 to survive in UNIX jungle.

For example, 'make check' of libiconv fails due to mismatch of CR+LF
and LF.
2016-12-15 17:37:04 +09:00
KO Myung-Hun 2b9eed78a0 move os2_init() from main() to main_init() 2016-12-14 11:05:50 +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 cc49df380e fix mksh_sdirsep() and simplify mksh_vdirsep() on OS/2
mksh_sdirsep() returned a position of a more far directory separator
if '/' and '\' were mixed.

And mksh_sdirsep() returned a position of ':' even if a directory
separator follows. For example, in case of 'x:/', the position of
'/' should be returned not ':'.

mksh_vdirsep() were simplified with mksh_sdirsep().
2016-11-12 15:23:24 +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 6d5496a81c make both cats 2016-11-12 00:20:37 +00:00
tg 0ba220d2c4 gcc 6.2 warnings (stupid uninitialised that wasn't, plus FALLTHROUGH fixes) 2016-11-11 23:48:30 +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 3aac3c30b5 return 128+SIGALRM if read with timeout timeouts, inspired by GNU bash 2016-11-11 22:17:09 +00:00
tg 945ef46af1 document print builtin changes 2016-11-11 21:37:44 +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 2f63478bc9 restructure so that the trailing separator is output separately from
the inner line separators
2016-11-11 20:22:52 +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 5ee8ba10b3 fix lazy evaluation with side effects; spotted by ormaaj via IRC 2016-11-07 16:58:48 +00:00
tg 7fef6b129e apply patch from Brian Callahan <bcallah@devio.us> for better pcc support 2016-11-07 16:55:51 +00:00
tg 038cfe7476 shave five spaces off .rodata with no functional difference 2016-10-26 22:55:51 +00:00
tg ac405dd6b7 avoid even the chance at UB, it’s too risky with “postmodern” compilers 2016-10-22 23:56:50 +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 9c602791b2 today, Andreas Buschka learnt that the Oxford comma is an american thing
(except for exactly the University of Oxford or to disambiguate)
2016-09-29 09:04:56 +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 a838564cec Unicode 9.0.0 (code and data part; FixedMisc font tbd) 2016-09-01 12:55:21 +00:00
KO Myung-Hun 46ed22a2bb Preserve coding styles of upstream
modified:        exec.c
2016-08-26 08:42:29 +09:00
tg e5e3fb3fc7 outstanding bumps 2016-08-25 16:21:34 +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
tg fa94f0339e experiment with GCC 5’s new -malign-data=abi 2016-08-24 20:50:11 +00:00
tg bb796ff785 simplify manpage and code; streamline manpage formatting and Satzzeichen 2016-08-24 20:40:00 +00:00
tg 35bd16ddfa this bug has long been fixed 2016-08-24 19:36:26 +00:00
tg 91b5d4b3ad remove all mentions of “the null string”, it’s an empty string (in most
cases), or an unset parameter (in some cases)
2016-08-24 19:35:26 +00:00
KO Myung-Hun ef42532640 Merge tag 'mksh-R53a' into HEAD 2016-08-13 15:11:41 +09:00
KO Myung-Hun d4be6d4358 Merge tag 'mksh-R53' into HEAD
Conflicts:
    exec.c
2016-08-13 15:05:49 +09:00
root 61a50ea6ba This commit was manufactured by cvs2svn to create tag 'mksh-R53a'.
Sprout from master 2016-08-12 16:48:05 UTC tg <tg@mirbsd.org> 'fix refactoro, spotted by Natureshadow; add (working) testsuite for all operators'
Delete:
    Makefile
2016-08-12 16:48:06 +00:00
tg 879c6a0911 fix refactoro, spotted by Natureshadow; add (working) testsuite for all operators 2016-08-12 16:48:05 +00:00
root fe672422e7 This commit was manufactured by cvs2svn to create tag 'mksh-R53'.
Sprout from master 2016-08-10 18:20:18 UTC tg <tg@mirbsd.org> 'bump, required by XTaran'
Delete:
    Makefile
2016-08-10 18:20:19 +00:00
tg 2db6d0a08c bump, required by XTaran 2016-08-10 18:20:18 +00:00
tg bb7226277b fixes 2016-08-10 18:20:05 +00:00
tg b58ff810a5 mention bases can (naturally…) only go up to 36, requested by izabera 2016-08-10 18:15:18 +00:00
tg f26cf0562b fixup a bad OpenBSD reaction on a bug afl showed:
set source to NULL only if the memory backing source is actually reclaimed;
fixes segfault due to NULL(+24) pointer dereference reported by Score_Under
(simplified testcase added; thanks!)
2016-08-04 20:51:35 +00:00
tg e52a2bb23f assorted code cleanup, while here anyway 2016-08-04 20:32:14 +00:00
tg d96229b205 make command() not trash the global source variable
removes local save/restore around it in two of three callers;
the third one is in runtrap() which… probably *cough* ought
to have danced the same…
2016-08-04 20:31:01 +00:00
tg 3e8165b9cd fix groff issue pointed out by lintian
surprisingly enough, no changes needed for the gcc6 switch in Debian sid…
2016-08-04 09:27:59 +00:00