tg
30d8e3934d
SUSv4 says trap foo UNKNOWN is not a syntax error, merely exit ≠0.
...
Inspired by 673dab8698b0399c967216c02262eaf95361a75c.
2011-01-30 01:36:00 +00:00
tg
bdfcdc56c8
introduce MKSH_NOPROSPECTOFWORK which is like pdksh’s JOB_SIGS in reverse, like MKSH_UNEMPLOYED is pdksh’s JOBS in reverse; allows mksh to work (hah! no pun intended…) with klibc (and possibly, Syllable Desktop and Plan 9) for now, until they fix their bugs
2011-01-30 01:35:35 +00:00
tg
07889fb0eb
-DIN_MKSH is not used by anything
2011-01-29 19:07:16 +00:00
tg
414c09ab1a
plug regression introduced with read -d by fixing the problem differently
2011-01-22 20:33:14 +00:00
tg
9b02e15d26
For prev-hist-word, when doing other things in between reset the counter
2011-01-21 22:43:17 +00:00
tg
da9d0f3d97
${foo@x} is now special-expansion for values of x, defined for now:
...
‘#’ = hash of $foo
2011-01-21 22:25:34 +00:00
tg
846fbde3b8
add read with delimiter, like AT&T ksh93 (thanks Dave for the suggestion)
2011-01-21 22:00:17 +00:00
tg
865b267dbf
drop suspend alias in Android too
2011-01-21 21:07:11 +00:00
tg
cc31d86e3b
• implement KSHEGID, KSHGID, KSHUID variables by suggestion of Richard K.
...
(KSHEUID aka USER_ID already exists)
• simplify, speed up LCG and $RANDOM handling again
2011-01-21 21:04:48 +00:00
tg
1d6e0470e0
use header only if found
2011-01-21 20:51:56 +00:00
tg
7326331f30
RT|Chatzilla said in #!/bin/mksh that MSYS probably does mksh
2011-01-15 21:56:36 +00:00
tg
230f59d064
New functionality: assign here document to string variable directly,
...
without cat and temp files. Hacked in Lëtzebuerg ☺
This was the third try. Where to put this was not palpable… same for =(…)
2011-01-09 21:57:29 +00:00
tg
b4948e430f
this is a bashism but might be from ksh93 IIRC… still dead ugly as hell!
2010-12-19 20:00:56 +00:00
tg
ce160a8155
MKSH_SMALL need not imply !HAVE_REVOKE as default
2010-12-12 14:06:35 +00:00
tg
210608b199
regenerate all wcwidth code from UCD 6.0.0 and related tables,
...
and mgk25’s wcwidth.c 5.0 code; add check against 2-byte wchar_t;
optimise libc wcwidth(3) implementation taken from mksh and sync these
2010-12-11 16:05:03 +00:00
tg
beba20ea56
since dot.mkshrc is sourced by interactive shells anyway, and exporting
...
PS1 may hurt other shells, do not export it any more
reported by and fix suggestion / affected variables by Frank Terbeck
2010-11-26 21:08:54 +00:00
tg
27dce9168a
change behaviour of argument-less exit in traps to match SUSv4; Debian #599484 (original patch from Jonathan Nieder, thanks!) in a variant that appears to handle nested traps well
2010-11-01 17:29:05 +00:00
tg
e57379aab7
regenerate from Unicode 6.0.0
2010-11-01 17:28:49 +00:00
tg
29de79c7bf
mknod’s now demoted and only used as special-case builtin, in MirBSD only
...
built for the installer, to save time, as the original OpenBSD hack wanted
2010-10-08 17:56:57 +00:00
tg
c37518d509
ouch! \c? is DEL, not \c~
2010-10-08 17:30:05 +00:00
tg
3365cb8d0f
• Build.sh: fix a compiler warning which, had it not been irrelevant in
...
a mirtoconf check, would’ve been a real problem on an LP64 platform
• sh.h: work around a bad interaction between -Wformat on gcc and manual
string pooling for T_synerr, which is used in place of a format string
in some places
2010-10-01 19:04:38 +00:00
tg
895e8f584b
partial obsd sync:
...
- remove some old groff workarounds in SYNOPSIS
- avoid "Op ... Oc" constructions
except where the latter doesn’t work with nroff
2010-09-24 20:21:43 +00:00
tg
e169648b89
while here, change SETUID_CAN_FAIL_WITH_EAGAIN to abort immediately
...
by suggestion of Chris Palmer again
2010-09-19 19:28:23 +00:00
tg
b0b03a5a75
RNDEBUG showed that using the pushb_fast will have much fewer syscalls
2010-09-19 19:21:20 +00:00
tg
915b30adfe
revert part of the “size reduction” diff (zero size change though):
...
shellf() implies an shf_flush()…
2010-09-15 21:08:19 +00:00
tg
667d792d6a
• Address concerns of Chris Palmer from the Android security team
...
– possible integer overflows in memory allocation, mostly
‣ multiplication: all are checked now
‣ addition: reviewed them, most were “proven” or guessed to be
“almost” impossible to run over (e.g. when we have a string
whose length is taken it is assumed that the length will be
more than only a few bytes below SIZE_MAX, since code and
stack have to fit); some are checked now (e.g. when one of
the summands is an off_t); most of the unchecked ones are
annotated now
⇒ cost (MirBSD/i386 static): +76 .text
⇒ cost (Debian sid/i386): +779 .text -4 .data
– on Linux targets, setuid() setresuid() setresgid() can fail
with EAGAIN; check for that and, if so, warn once and retry
infinitely (other targets to be added later once we know that
they are “insane”)
⇒ cost (Debian sid/i386): +192 .text (includes .rodata)
• setmode.c: Do overflow checking for realloc() too; switch back
from calloc() to a checked malloc() for simplification while there
• define -DIN_MKSH and let setmode.c look a tad nicer while here
2010-09-14 21:26:19 +00:00
tg
08862021ee
add size optimisation hacks by me from Android except ifdef’d
...
(note, I’d prefer everyone to keep IDSTRINGs around though)
2010-09-14 21:15:11 +00:00
tg
dcbfc48855
┌──┤ apply Android patch from Jeff Hamilton:
...
│Don't alias 'stop' to 'kill -STOP'
│
│Android has already has a stop command used
│to stop the main runtime and the alias
│interferes with testing tools that expect
│stop to kill the runtime.
│
│Change-Id: I02b7efb9203dc39e97f63eb702a54ff79935b316
Although, this is closer to his first patchset and only takes
care of the alias, not the testsuite (which doesn’t run, at
least not out-of-the-box, nicely anyway) using #ifdef ANDROID.
We certainly want a more flexible testsuite…
2010-09-14 21:00:13 +00:00
tg
4f671299f4
lintian caught hyphen-used-as-minus-sign
2010-09-05 20:43:37 +00:00
tg
56a69907d5
optimise error messages, option parsing, and make more builtins
...
recognise "--", costs us 20 .text 0 .data 0 .bss
2010-09-05 19:51:35 +00:00
tg
07b97d5444
document workaround for the $(…) parsing bug
2010-09-05 19:12:24 +00:00
tg
2c59cc6089
more on the cat
2010-08-28 21:22:24 +00:00
tg
06c6be0a70
shave off another 468 bytes: we’re 300 bytes smaller than BEFORE the
...
cat builtin was added now… (also removed utf-8 from source files, in
favour of just ASCII)
2010-08-28 20:22:24 +00:00
tg
3747722db4
improve string pooling: saves 316 bytes in .text
2010-08-28 18:50:58 +00:00
tg
d09fd67299
make cat an mksh builtin, for things like here documents
...
if any options are given, the external programme is invoked instead
2010-08-28 17:21:46 +00:00
tg
297e2ced89
fix blocking_read prototype
2010-08-28 16:47:11 +00:00
tg
4e08a79555
whitespace
2010-08-28 15:48:20 +00:00
tg
475cafb90e
int → bool
2010-08-28 15:39:20 +00:00
tg
1924f91aad
this is 「category: os:mirbsd」 because of hardcoded errno and strerror values
2010-08-24 15:47:44 +00:00
tg
79623f9ceb
avoid more compiler warnings in mirtoconf phase
2010-08-24 15:46:06 +00:00
tg
a0d43a99fd
it’s ugly to write a ./stdint.h file if we can instead define the
...
types from sh.h; sync clog
2010-08-24 15:19:54 +00:00
tg
7fdc42cead
fix realpath builtin’s handling of (source) pathnames with a trailing slash
...
as per POSIX (if a trailing slash is part of the symlink target it fails as
well, like GNU readlink -f does)
2010-08-24 14:42:04 +00:00
tg
8b946de857
u_int32_t was only ever needed for OpenBSD’s pre-ISO-C arc4random API
...
since we don’t have that any longer, nuke it
2010-08-15 00:43:55 +00:00
tg
52f565f527
Tonnerre says his Linux 1.2 doesn’t have uint8_t, so check for it
...
and provide if necessary
2010-08-15 00:41:05 +00:00
tg
23f3f58d14
on MirBSD we can use the system wcwidth() and save ~800by on the ramdisc
2010-08-14 21:35:13 +00:00
tg
b5bdc6d10f
document the [[ $foo = "$bar" ]] thing expressly
2010-08-14 20:13:10 +00:00
tg
14dc6071e7
portable hogwash
2010-08-14 19:55:37 +00:00
tg
c187f3089f
a tad annoying, when external programmes such as GNU screen are running,
...
we don’t get SIGWINCH when the window size changes during the runtime of
that, so, the signal is only usable reliably during editing in the shell
and we re-check the window size before each interactive edit line again
2010-07-25 11:35:43 +00:00
tg
befbed2859
int → bool
2010-07-24 17:08:30 +00:00
tg
c11d35312a
Michal Hlavinka from Red Hat found another SIGSEGV
...
fix: when iterating over all Sources, know when to stop…
2010-07-21 11:31:16 +00:00