Commit Graph

234 Commits

Author SHA1 Message Date
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 f654a3dea4 fix libFirm/cparser -Wsign-compare 2012-12-05 19:38:25 +00:00
tg cf807eb83a Add assertions and shuffle code around for LLVM+Clang scan-build. 2012-12-04 01:18:34 +00:00
tg 68c4dae6ef Rewrite the getn function (again) to fix any remaining issues. 2012-12-04 01:12:11 +00:00
tg e36075e58d open distinguishes between >=0 and ==-1 but <-1 is undef, make it error 2012-11-30 17:34:46 +00:00
tg 0ce7dcf856 maybe this makes gcc not bitch… again… anal-retentive arsecompiler…
found in opensuse buildservice logs for centos 5
2012-10-22 20:52:47 +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 167995da22 repair choiceless select builtin 2012-10-03 15:13:34 +00:00
tg 9b7b7f742e implement ksh93 feature ${ foo;} 2012-07-30 21:37:17 +00:00
tg 6724ba505d make 'typeset -p' (and soon ${foo@$}) output strings safe for re-entry
into AT&T ksh93 (that we still must use octal, in this day and age,
because dgk’s \x is broken… tss…)

not round-trip, as ksh93 doesn’t encode hi-bit7 or \v, but safe
2012-07-20 21:18:45 +00:00
tg 4778a2a62f lesson learned from http://k1024.org/~iusty/blog/entry/perf-null/ – add -DMKSH_SMALL_BUT_FAST which gives more speed (8/20K less cycles, 5/9K less insns, 1.8/2.4k less branches, 65/275 less branch misses) on Debian/amd64 (klibc-static/eglibc) at cost of 0/2 more page faults and 6K/6K more text size 2012-07-01 15:55:00 +00:00
tg cbeac6b381 disable mksh feature -T in lksh 2012-06-26 19:22:19 +00:00
tg ea8f29f428 sprinkle CONSERVATIVE_FDS for many older OSes; DISABLE_TTY_WARNING for BeOS and Coherent (probably more to come); NO_CMDLINE_EDITING to Plan 9; put Hurd NO_PATH_MAX into MKSH__ private namespace 2012-05-05 17:37:44 +00:00
tg 64447e738d my own over-optimisation prevents me from making the MKSH__NO_SYMLINK
case as nice as it could be, since part of the “if (0) {” case is jumped
into for the first run of the loop… thanks RT
2012-05-05 15:10:39 +00:00
tg fef3808126 more symlink(7) nonexistence support code 2012-05-04 22:05:02 +00:00
tg 401116766b generalise the skipping sete{u,g}id() case for Coherent, not just BeOS 2012-05-04 21:57:38 +00:00
tg 5780bc5eb7 new MKSH_NO_CMDLINE_EDITING to disable command line editing in its entirety
mainly for the Plan 9 port though it may also help the WinAPI variant,
other porting efforts, as well as a new project I cannot say yet
2012-05-04 20:49:08 +00:00
tg 7c4bf78446 move bi_getn from misc.c to funcs.c and make it static
even antique gcc versions will usually inline it now
2012-05-04 20:08:25 +00:00
tg 4a89ae1cd0 drop the need for strcasestr: just uppercase a copy and compare with uppercased 2012-04-06 12:59:28 +00:00
tg c30bf73a56 BeOS has no tty nor uid/gid other than 0, a̲n̲d̲ a broken /bin/sh 2012-04-01 16:55:16 +00:00
tg 64afff52c1 winstonw made me discover there is no ELOOP in Plan 9:
http://plan9.bell-labs.com/sources/plan9/sys/include/ape/errno.h
2012-03-26 20:04:05 +00:00
tg 24e8a6996b always keep x_cols and x_lins valid; check once at start including tty init
if we find any, but not later; do not check on every read

⇒ allows changing COLUMNS and LINES (independent of each other, or both)
  for script shells by passing them in an environment setting, even if
  we get a tty; interactive shells still check before each line is read…

reported by the PLD guys, thanks
2012-03-23 21:58:24 +00:00
tg 3795e667c5 drop use of the NOT macro, [^foo] ≠ [!foo] anyway, and we’re not gonna change that 2012-03-23 20:07:13 +00:00
tg c06e3979a8 I hate having to do those year bumps… 2012-01-04 22:38:33 +00:00
tg ac29bad3fe fix regression escaping single-char strings 2012-01-04 19:09:36 +00:00
tg 4af399bd8d give dumptree an dumpioact helper 2011-12-29 22:54:22 +00:00
tg 24fbbdf31c -Wpointer-sign 2011-12-03 00:03:25 +00:00
tg da83890648 move compile-time assertions out of misc.c(#ifdef DEBUG) into Build.sh 2011-12-03 00:01:28 +00:00
tg 92b60a9a5e forgotten in cid 1004EA5BF612F516747 to take '\n' presence as $'…' quoting reason 2011-10-26 20:46:16 +00:00
tg fed31331f4 rename more identifiers with trailing underscores 2011-10-25 22:36:39 +00:00
tg cd7dab250b also Xcheck_grow_ may not end with an underscore 2011-10-25 22:25:07 +00:00
tg 3b9ec6c3c4 also emit newline as backslash-n to align with GNU bash (and to keep everything on one line) 2011-10-24 19:40:58 +00:00
tg 5416abb2d0 when printing for-reentry parameter values, use dgk’s $'…' for non-ASCII characters 2011-10-24 19:40:46 +00:00
tg 9782f6b4d1 • access(2) is broken in at least kFreeBSD 9.0 as “modern” OS, so bring
back the wrapper code as well as refactor most other code calling it
• apparently, names can’t end in ‘_’ or contain ‘__’ anywhere…
2011-09-07 15:24:22 +00:00
tg 577c918beb patch most of Jerker Bäck’s concerns out, unless not applicable 2011-08-27 18:06:52 +00:00
tg 5d9c88ceeb jg71 reported -DMKSH_ASSUME_UTF8=* breaks defining stristr 2011-08-27 17:30:07 +00:00
tg 3ef67e3296 replace uses of OAAT hash in all its variants by NZAT (mksh internal) or NZAAT (all others) 2011-07-06 22:22:02 +00:00
tg 6807ce3100 drop long-deprecated 'set ±o arc4random' 2011-06-12 15:37:10 +00:00
tg c133d423df ACK found a missing "static", gcc on Minix found a missing cast; add more type size checks 2011-06-12 14:45:34 +00:00
tg 2cfc3e5c3d mksh R40 Release Candidate 1
Testsuite:
• add new need-pass: {yes|no} attribute, default yes
• exit with 1 if a need-pass test failed unexpectedly
  idea by Kacper Kornet <draenog@pld-linux.org>
• mark utf8bom-2 as need-pass: no
Infrstructure:
• add housekeeping function for making a tty raw
• switch functions with unused results to void
• struct op: u.charflag contains last char of ;; in TPAT
• var.c:arraysearch is now a global function
Language:
• add ;& (fall through) and ;| (examine next) delimiters
  in addition to ;; (end case) as zsh extensions, because
  POSIX standardised on ;& already
• add -A (read into array), -N (read exactly n bytes),
  -n (read up to n bytes), -t (timeout) flags for read
  from ksh93
• allow read -N -1 or -n -1 to slurp the entire input
• add -a (read into array the input characters) extension
  specific to mksh to read, idea by David Korn
• add -e (exit with error if PWD was not set correctly
  after a physical cd) to cd builtin, mandated by next
  POSIX, and change error codes accordingly
Rewrites:
• full rewrite of read builtin and its manpage section
• add regression tetss for most of the new functionality
• duplicate hexdump demo tests for use of read -a
• use read -raN-1 in dot.mkshrc to get NUL safe base64,
  DJB cdb hash and Jenkins one-at-a-time hash functions
2011-05-29 02:18:57 +00:00
tg 4345dd1fb8 += support for variables and arrays 2011-05-04 23:16:05 +00:00
tg b91b037e6a we got a decision on pathnames with exactly two leading slashes
thanks, Eric and David!
2011-03-28 21:31:01 +00:00
tg 5f31b8c97a • bring back test -H ifdef S_ISCDF (for HP-UX)
• whitespace, etc.
• bump version for tonight, I’m not gonna hack on c_cd,
  all this pathname stuff is mind-boggling…
2011-03-26 21:46:06 +00:00
tg a55de5f840 • rewrite simplify_path() to keep more in line with do_realpath()
• add regression test to ensure that //foo pathnames are never simplified
2011-03-26 21:09:09 +00:00
tg 7d86eaba8c simplify code to use existing $PWD 2011-03-26 19:43:49 +00:00
tg c2333a7dbd simplify_path: we CANNOT simplify pathnames beginning with //
since they’re implementation-defined and *not absolute*!
2011-03-26 19:29:41 +00:00
tg b1d97ea44e temporary patch for Cygwin against cd breaking UNC pathnames
from Chris “ironhead” Sutcliffe
2011-03-26 15:37:19 +00:00
tg 803c51914b • move funcs.c:do_realpath() to misc.c and make it global
⇒ consider merging simplify_path()
• move funcs.c:c_cd() to misc.c
• make misc.c:make_path() static, c_cd() is its only user
  ⇒ mark as obsolete
• tweak misc.c:set_current_wd() to drop ksh_get_wd() argument

should be no code change, but the entire path stuff is a mess…
so expect actual implementation changes or even rewrites shortly
2011-03-24 19:05:49 +00:00
tg 3c41d2b063 fix cast; bump version 2011-03-17 22:09:23 +00:00
tg 2f2fe89157 • write a pattern optimiser and call it before invoking do_gmatch(),
to catch several very slow cases (especially “*@(*foo)” busy-loops
  – spotted by Jb_boin as usual these days ☺) by converting all @(…)
  with one case to drop the enclosing MAGIC(…), and in a second pass
  collapsing adjacent asterisk (‘*’) wildcards
2011-03-17 22:00:45 +00:00