Commit Graph

309 Commits

Author SHA1 Message Date
tg 1df3efdb86 another intermediate step/commit to get arithmetics right:
do the correct operations for comparisons (just keep using the
signed/unsigned switch from bivui for them), division (by working
on absolutes and adding the sign at the end), modulo (stupidly by
divising in signed, multiplying and subtracting, to get the sign
of the result right)

also adds rotation

XXX to check: do we need to AND before assigning the result in division?
2013-04-14 13:36:53 +00:00
tg 94dfda0be0 RCSID sync w/ oksh; whitespace (KNF) 2013-03-24 21:34:14 +00:00
tg a3b5e77c6c disable parsing of &> as GNU bash iop if -o posix or -o sh, based on IRC discussion where jilles(IIRC) pointed out it breaks existing valid scripts 2013-03-24 15:01:50 +00:00
tg 4b2e17b828 • let mksh “set -x” print whole TCOM trees
• plug some memory leaks in debug (“set -x”) and warning paths while here
• one from Florian (friend of Natureshadow) for WTF
2013-03-24 00:56:27 +00:00
tg 74e2ef8b0b one more int → bool; mention “set -o sh” may (on raare OSes) be enabled
automatically (and it differs between targets); test MidnightBSD 0.1 ash
compat code and adjust the testsuite so it passes with it enabled
2013-02-19 18:45:22 +00:00
tg 2c76875ea3 • Document invalid ${a/b/c} patterns in manpage (Debian #698678)
• add speed hints and misc improvements; bump version
2013-02-11 17:17:59 +00:00
tg 63cf38eca7 sync description for funsubs 2013-02-10 23:58:19 +00:00
tg 24164e07d4 rcsid-only sync 2013-01-19 17:27:05 +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 007cf09db6 use EPOCHREALTIME as variable, somewhat compatible with “zmodload zsh/datetime”, as ormaaj belatedly found out 2012-11-26 22:49:51 +00:00
tg f284261018 • update documentation and references
• say R41, we’re almost feature-complete, and the missing one
  will not require documentation updates
2012-11-20 18:25:12 +00:00
tg 13da062f92 add MKSH_UNIXTIME 2012-11-20 18:07:45 +00:00
tg 435bc124ef introduce $BASHPID for ormaaj from #ksh 2012-11-20 17:42:32 +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 b843e91274 point out the miros-mksh@ mailing list, thanks Andrew Kudryashov 2012-10-21 17:42:51 +00:00
tg b853fcc002 fix default for HISTSIZE as pointed out by Andrew Kudryashov (thanks!)
XXX still, only the !MKSH_SMALL case is handled in the manpage
2012-10-14 14:04:05 +00:00
tg bb5e56d4c4 remove ${ foo;} from mksh again due to buffering issues jilles found 2012-08-17 18:34:25 +00:00
tg 31ad60ea89 do not advertise printf(1) 2012-08-03 18:34:31 +00:00
tg 9b7b7f742e implement ksh93 feature ${ foo;} 2012-07-30 21:37:17 +00:00
tg cb5b1b3a88 another rcsid-only sync 2012-07-25 19:40:40 +00:00
tg 058e7f8ed4 do implement quoting, as ${foo@Q} though, as hommage at mirmake
dedicate this “release” to Andi
and use tomorrow’s (UTC) day for version, to cover up my debian fuckup
2012-07-20 23:22:13 +00:00
tg 01e1b0de24 lksh: mention IRC and ML; mksh: mention SSL 2012-06-29 08:11:45 +00:00
tg ea01d80833 hackish work-around the lexer to make alias definitions in mksh -c
work (Closes: #517009) and mention in the manpage why they sometimes
do not work (doing so for COMSUBs is not worth the effort)
2012-06-28 20:05:11 +00:00
tg 1f5c10c8b6 sync w/ oksh 2012-06-25 16:22:59 +00:00
tg 5204e7cc4f after discussion with ciruZ, switch mksh from NZAT to NZAAT fully
to get rid of the bias introduced by making the hash never zero

… he also pointed out a memory (heap) usage optimisation… which
may impact code size a bit though as I’d need to pass an additional
argument on hashtable function calls… or, forgo the benefit of not
having to pointer-align the key in the structure, which can be as
much as 3/7 octets per item, heap storage… OTOH the saved space is
4/8 octets per not-allocated item, possibly some code (use of an
multiply-add opcode), but the function call overhead/cost would
possibly be quite a bit… I guess I’ll have to measure…
2012-04-22 21:50:35 +00:00
tg d388de51f9 update to latest portmdoc; apply the Lt/Gt/Ba rule again 2012-04-14 12:51:34 +00:00
tg 5b4d0dbbc5 drop all deprecated code, you have been warned 2012-04-07 11:19:53 +00:00
tg 21c15c0b8f huh, I thought I had extended ${parameter@#hash} already; make it so now,
but not yet things like ${parameter@Fi} (1 if integer, 0 otherwise), etc.
also bump patchlevel and © years in recently changed files
2012-03-23 23:25:30 +00:00
tg 3b87d173d4 • finally, the code and manual page text to deprecate, and code to not
handle any more, octal 010 style constants, as promised
• overhaul the manpage re. arithmetic expressions, make the guarantees
  mksh code has explicitly, precisely, clear
• to reduce burden of the compiler, getint() now operates on mksh_uari_t
  internally; it already applied the sign after operation, anyway (C99
  guarantees wraparound on unsigned types, but for signed types we need
  specific compiler support; apparently, this comes from hardware limits)
• use const and shuffle order of locals around while here
2011-12-10 13:34:19 +00:00
tg 3522dd1263 add note that mksh's global is not php/python's 2011-12-03 00:09:15 +00:00
tg 2fb9df56e4 rewrite funcs.c:c_test(), i.e. test(1) and [(1), to follow POSIX and XSI
in the cases where they are defined unambiguously; bug reported by
Jilles Tjoelker in <20111129232526.GC14357@stack.nl> due to a report
by Stefano Lattarini on bug-autoconf

in the ambiguous case, I stick to traditional pdksh behaviour, which means
	test ! a = b	vs.	test a = b
and
	test ! a -o b	vs.	test a -o b
behave different from each other (in the second case, the NOT operator
binds strong; POSIX demands a reduction to 3 arguments and negating
that result in the first case), so we're at two known not-ok in the
FreeBSD® testsuite. (81 and 82 in regress.sh,v 1.3)
2011-11-30 21:34:15 +00:00
tg 7e719a4cc1 deprecate the UGLY input line beginning with ! hack 2011-11-11 22:14:02 +00:00
tg cf4e967a5e fix: "foo" in nroff is quoted, \&"foo" contains literal gänsebeinchen 2011-11-11 22:10:52 +00:00
tg 5893a36bad document “export -” accident found by Snader_LB 2011-10-24 19:41:13 +00:00
tg 9eaf6a8e12 remaining sync with oksh (pointless rcsid, no code diff) 2011-10-07 19:51:29 +00:00
tg 84096a0a86 Message-ID: <CAOw7k5gBmt+WqzQxgK8xrjMvCh3iBHcQ7cU78cy1WbzRf8d_Hg@mail.gmail.com>
just to make sure, got a copyright licence for this
2011-09-13 18:46:46 +00:00
tg 308290e2b6 dict.leo.org says this is correct 2011-08-13 22:19:41 +00:00
tg e03b485d75 ‣ merge from mksh R40-stable
move /etc/{,suid_}profile to /system/etc/ for Android (but do not make
the location of /etc configurable); rewrite manpage section about
/etc/{,suid_}profile, .profile, .mkshrc
2011-07-16 17:08:21 +00:00
tg b0ee967d00 ‣ merge from mksh R40-stable
first part of long-overdue manpage improvements
2011-07-16 17:08:04 +00:00
tg d6445aa007 ‣ merge from mksh R40-stable
document the unportability of the echo utility;
arekm's non-bug report inspired this
2011-07-16 17:07:48 +00:00
tg 851f8fb7d8 introduce MKSH_NO_EXTERNAL_CAT skipping the “call /bin/cat if we have an
option” nonsense, intended for Android, Plan 9, and other systems which
honour that cat -v is deemed harmful
2011-07-07 21:24:53 +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 fe2c0221b3 replace typeset with local, as style(9) now mandates
(keep globals for a while, until it’s widespread, though)

since we don’t export PS1 any longer, no need to stay AT&T ksh compatible
2011-07-05 20:19:18 +00:00
tg 64aade1a52 add new experimental "global" command 2011-07-02 17:57:24 +00:00
tg 535649cc60 sync clog 2011-06-21 22:02:09 +00:00
tg 6807ce3100 drop long-deprecated 'set ±o arc4random' 2011-06-12 15:37:10 +00:00
tg 463dc26db4 drop the RC 2011-06-12 15:34:19 +00:00
tg 00e1a6752d hyphen-used-as-minus-sign 2011-05-29 17:01:26 +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 3f21a0e199 • add patch from Robert Luberda <robert@debian.org> fixing the
four-argument form of test (yet again…), thanks
• drop the obsolete (pre-POSIX) form “test -t” without fd
2011-05-06 15:41:25 +00:00