Commit Graph

382 Commits

Author SHA1 Message Date
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 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 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 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 d4be6d4358 Merge tag 'mksh-R53' into HEAD
Conflicts:
    exec.c
2016-08-13 15:05:49 +09: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 f9d131133e remove fd>9 support in favour of upcoming named file descriptors; bump 2016-07-25 21:05:25 +00:00
tg aa9fa0ebfe add a testcase as documentation (why POSIX isn’t everything); fix comments 2016-07-25 20:36:28 +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
KO Myung-Hun 68f6e899ef Merge tag 'mksh-R52c' 2016-03-05 14:59:34 +09:00
tg f23ed68f00 clean up, avoid aliasing concerns in non-debug case 2016-02-26 21:53:37 +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 e9364a4318 Merge remote-tracking branch 'mksh/master' 2016-02-25 14:56:35 +09:00
tg f0a042f070 implement mmap-using mechanism to catch buffer underruns inside mksh
(pulls stdio, is rather BSD-specific and memory-hungry and a bit slow)
2016-02-24 01:44:46 +00:00
KO Myung-Hun 36ea6b5f88 Merge remote-tracking branch 'mksh/master' 2016-01-24 16:43:45 +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
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 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 eb9050b8f8 stop using issetugid(2) for ±p check as it’s probably not the right tool 2015-10-05 17:59:00 +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 df20ee1fff Merge remote-tracking branch 'mksh/master'
Conflicts:
	check.t
	main.c
2015-08-15 23:45:52 +09:00
tg 1b8b792b7e quote path separator if ; in some cases; pointed out by komh 2015-08-13 22:06:23 +00:00
KO Myung-Hun 26c9cc9318 main: remove EXE_EXT macro
Upstream introduced MKSH_EXE_EXT.

    modified:   main.c
2015-07-21 16:30:48 +09: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 950827394b more easy OS/2 fixes
From: KO Myung-Hun <komh@chollian.net>
2015-07-09 19:46:43 +00:00
tg 041666eefb a few more mksh-os2 inspired fixes 2015-07-09 19:28:21 +00:00
tg 3d8ba005e1 add a few generic fixes from mksh-os2
From: KO Myung-Hun <komh@chollian.net>
2015-07-09 19:19:10 +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 e0196f47d5 implement completely new multiline code by delaying history store
this commit is valgrind-tested
2015-07-05 19:37:18 +00: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 3af76d7f94 Check sh.exe on OS/2 intead of sh 2015-06-03 13:00:47 +09:00
KO Myung-Hun 07e5cadc54 Support a response file on OS/2 2015-06-03 13:00:43 +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 fdd0831a58 Check EPERM as well on OS/2
fcntl() on OS/2 kLIBC may return EPERM instead of EBADF in this context.
2015-06-03 13:00:42 +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 8f633da789 Path separator is ; on OS/2 2015-06-03 13:00:40 +09:00
tg 609b311919 more low-hanging fruits for EBCDIC; notes:
• ord() new, From: Daniel Richard G. <skunk@iSKUNK.ORG>
  ‣ used in some places
• (c - '0') → ksh_numdig(c)	# may take *x++ argument
• (c - 'A') → ksh_numuc(c)	# may NOT take *x+= argument
  ‣ idem for ksh_numlc(c) and 'a'
  ‣ these need changing for EBCDIC
  ‣ add testsuite for this
• use macros more, they exist already often
• use digits_lc[foo] instead of ('0' + foo), especially for letters
• caught another ksh_eq case…
• also caught a maybe-UB overflow check, but we don’t have TIME_T_MAX ☹
2015-04-29 20:07:35 +00:00