Commit Graph

665 Commits

Author SHA1 Message Date
tg 63b6d920a8 actually, only needed #ifdef DEBUG 2013-02-10 17:39:38 +00:00
tg cb93db360d call afreeall(AEDIT) upon close; related to LP#1106116 2013-02-10 17:38:15 +00:00
tg 1da94d6159 pure RCSID sync with oksh, who also added a tabcompletion fix now, with
less code, but, even according to their own comments, not as good as ours
2013-02-10 17:18:49 +00:00
tg 9111faeeb5 besides more code reuse, fix $'…' everywhere (but keep it ignored in here document bodies that aren’t here strings) 2013-01-19 19:47:13 +00:00
tg 2d9a039ec0 ormaaj reported “command shift” not working correctly; fix 2013-01-06 18:51:43 +00:00
tg 744f77c668 fix running the ERR and EXIT traps in case of set -e and/or eval (includes Debian #696823) 2013-01-01 20:45:04 +00:00
tg 0700d45ce6 while thinking about mirlibₘᵢₙc I figured that sys_errlist[] entries may be NULL 2013-01-01 03:32:44 +00:00
tg d91800c88d RT’s build logs show that do{}while(0) is better than functional programming 2012-12-28 04:47:50 +00:00
tg 113db497ba RT says QNX 4 has _SIGMAX not SIGMAX or NSIG 2012-12-28 03:35:34 +00:00
tg b2396677e7 harmonise sys_{sig,err}list ⓐ checks, ⓑ uses, ⓒ _decl values when not needed, ⓓ prototypes; ⓔ “const” is a keyword and thus space-separated from the preceding ‘*’ pointer indicator 2012-12-28 02:28:39 +00:00
tg 865728fb3d let printf stuff compile again after cstrerror-related change 2012-12-22 22:15:21 +00:00
tg 6d5e27a31a gcc-snapshot (see below) issued a clobber warning, and both it and mgcc
yowled about the memmove test until I found a compromise
gcc version 4.8.0 20121120 (experimental) [trunk revision 193662] (Debian 20121120-1)
2012-12-22 00:03:42 +00:00
tg ce602be6be sync clog et al. 2012-12-17 23:46:33 +00:00
tg 12c662b6e2 thanks to ISC (Interactive) Unix, we now know a few samples of errnos
that get used, plus one for the realpath-1 regression test; also make
sys_siglist_decl detection nicer and poison strerror() with non-const
return value ifdef DEBUG, make it always const
2012-12-17 23:18:11 +00:00
tg 4c5d7094ef RT also said what was missing on SunOS 4.1.1 (it also needs -DMKSH_UNEMPLOYED?) 2012-12-17 22:14:27 +00:00
tg b8d3f12025 merge/genericise RT’s port to Minix-vmd 2012-12-17 21:55:06 +00:00
tg c4e88acd83 Correct mistake when doing hashtable lookup collision resolution… oops 2012-12-07 23:46:38 +00:00
tg f654a3dea4 fix libFirm/cparser -Wsign-compare 2012-12-05 19:38:25 +00:00
tg d8a6ce41de shuffle declarations around (all shared between even only two files go into sh.h even if they’re not supposed to be used elsewhere) and make some static; libFirm/cparser has -Wmissing-declarations against it 2012-12-05 18:54:10 +00:00
tg cf807eb83a Add assertions and shuffle code around for LLVM+Clang scan-build. 2012-12-04 01:18:34 +00:00
tg b868c517b7 remove *all* nonnull assertions and other workarounds for clang scan-build
this beast evolved in the last 2½ years, and we’ve had trouble with
some of them earlier
2012-12-01 01:36:30 +00:00
tg ce6cdb96f2 regenerate Makefiles 2012-11-30 20:49:18 +00:00
tg 0f3071a8b2 MKSH_DISABLE_EXPERIMENTAL is a NOP again; use ${ precmd;} in dot.mkshrc 2012-11-30 20:19:16 +00:00
tg f63bcae02c … oh well, but MidnightBSD gcc picks on "" too, so just stick to NULL, it’s cheapest 2012-11-30 19:58:48 +00:00
tg 0f46c5e321 so’s clang… 2012-11-30 19:57:35 +00:00
tg 9a6ebef8ca The MidnightBSD/amd64 system compiler (Target: amd64-undermydesk-freebsd)
gcc version 4.2.1 20070719  [MidnightBSD] has stricter -Wformat checking
2012-11-30 19:51:25 +00:00
tg 77c4cb88e4 implement tty tracking and bump to R41 for feature completeness
• tty_fd is now never closed
• new tty_hasstate tracks tty_state (cf. thread around
  http://article.gmane.org/gmane.os.miros.mksh/79 and PLD bug)
• as users requested, importing COLUMNS or LINES from the environment
  now removes its special-ness as does unsetting it
• otherwise, setting COLUMNS or LINES is honoured until the next SIGWINCH
  arrives or change_winsz is otherwise run (e.g. before displaying the
  prompt in the interactive command line editing modes)
• SIGWINCH is now honoured before each reading of $COLUMNS and $LINES too
• change the Uhr to match – it no longer calls stty(1) ☺
2012-11-30 19:25:08 +00:00
tg cbf1cea38a sync clog 2012-11-26 23:14:46 +00:00
tg 2fc5aa487b RT tells me Minix 2 (i386) also doesn’t have gettimeofday(2) 2012-11-20 18:50:46 +00:00
tg 68d8d83e67 add checks for ~+ and ~- (inspired by posh change) and bump date,
as I’m not likely to continue hacking tonight
2012-11-12 19:13:46 +00:00
tg 222d50f1af save some space for error-less error messages
inspired by a bugfix for posh for something that was not a bug in here
2012-11-12 18:28:40 +00:00
tg 5aa7842d33 who would’ve thought proper ^C handling be so hard? 2012-10-30 20:49:44 +00:00
tg 8caee45c60 int → bool 2012-10-30 20:13:20 +00:00
tg faa0a78df3 restore yyrecursive context in quitenv (LP#1069428) 2012-10-30 20:07:15 +00:00
tg bfe7d78d40 bring back ${ foo;} sans dot.mkshrc patch, using a temporary file, and as experimental feature 2012-10-22 20:19:18 +00:00
tg 574c024635 introduce MKSH_DISABLE_EXPERIMENTAL and wrap the new feature introduced
in cid 1005084678C510CF7E4 in it
2012-10-22 16:53:22 +00:00
tg c7419d9e6a defer setting exstat for eval to 0 (the one used in case shell() is empty)
until after the stuff run in shell() has had a chance to toy with $?

bug forwarded by one of our packagers, found by one of their users
2012-10-21 21:55:05 +00:00
tg 31f24a4040 add some bounds, for a subsequent commit:
• all writers of exstat ensure the value is in [0; 0xFF]
• all readers of exstat AND it with 0xFF (not strictly needed thus)
• trap_exstat is “safe”, i.e. always either -1 or [0; 0xFF]
2012-10-21 21:39:06 +00:00
tg bebb2d2254 EXPERIMENTAL optimisation for “sh -c 'foo'” to equal “sh -c 'exit foo'” iff
several conditions are met as outlined below; for more background, refer to
http://www.FreeBSD.org/cgi/query-pr.cgi?pr=113860

We don’t yet optimise 「% sh -c '{ echo a; sleep 10;}&'; sleep 1; ps T」 so
the FreeBSD® sh approach cannot work for us, but scanning the “sh -c” argu‐
ment for disallowed characters and, if not, setting a flag that enables the
shell to exec the tree when parsed as TCOM *and not c_trap()* was possible.

Disallowed characters are currently C_QUOTE except space, that is:
Tab Newline " # $ & ' ( ) * ; < = > ? [ \ ] ` |

This should catch all cases of magic, variables, subshells, pipelines, etc.
2012-10-21 21:26:41 +00:00
tg d8662eb228 even more hacks to pass “-O666 -fstrict-overflow -Wstrict-overflow=9 -flto=jobserver” with “gcc version 4.8.0 20120930 (experimental) [trunk revision 191865] (Debian 20120930-1)” ☹ plus make the rtchecks mandatory 2012-10-03 17:24:23 +00:00
tg c39bfe09ee rewrite some code to avoid gcc 4.8 complaining 2012-10-03 16:16:15 +00:00
tg b55d9870e3 reorder notoktomul to have the constant as second argument like notoktoadd 2012-10-03 15:55:37 +00:00
tg 0575d07671 rewrite XPtrV to use size_t instead of pointer arithmetic, for gcc-snapshot (20120930-1) -fstrict-overflow -Wstrict-overflow=9 2012-10-03 15:50:32 +00:00
tg 167995da22 repair choiceless select builtin 2012-10-03 15:13:34 +00:00
tg 9fbdef8e60 pure RCSID sync with OpenBSD, as we introduced SIGWINCH tracking earlier
XXX we could track whether tty_fd has already been successfully opened,
XXX the ttystate initialised, and then just never close it unless it is
XXX necessary, then we can keep COLUMNS/LINES accurate in scripts, even
2012-09-21 17:20:22 +00:00
tg eac85ffdf1 OpenBSD found out that "building argv for $* and $@" manipulates l->argv
in place which affects ps(1) output on BSD; create a new array and copy
the original parts from argv[] there without touching argv passed to main
2012-09-07 21:02:43 +00:00
tg 0415b74436 Update wcwidth data from Unicode 6.1.0 2012-09-01 23:46:41 +00:00
tg e6ddeaa53d sync clog 2012-08-24 21:33:51 +00:00
tg e2d1f3bf99 related to LP#1025843 fix tab completion for tilde
this code is insane, who wrote globbing and expansion for mksh’s
predecessor must have been on very interesting drugs
2012-08-24 21:15:42 +00:00
tg 42ac0dc08e second attempt at getting '$FOO/b*r/baz' tab-completed right,
plus the beginning of the tilde fix… do not use, this is fucking
impossible to get right, but I’d like an archival commit
2012-08-24 20:57:46 +00:00