tg
151d913115
remove all but these __CRAZY=Yes build warnings:
...
main.c: In function 'main':
main.c:208: warning: cast discards qualifiers from pointer target type
main.c:329: warning: cast discards qualifiers from pointer target type
no warnings at autoconf time left either; will take care of these two later
(might revisit changes from this commit), maybe change declararion for the
builtins to have their argv[] be const strings, and go through strict type
and qualifier checking again. this'll further improve stability.
XXX these changes might have introduced (more?) memory leaks,
XXX someone who knows about these tools should verify with
XXX automatic memory usage analysers (valgrind?)
still passes testsuite
2006-11-12 14:58:16 +00:00
tg
2c1ffced08
unbelievably, cygwin doesn't have strcasestr(3)
2006-11-12 13:15:27 +00:00
tg
62d9cf9fa9
only auto-enable set -o utf8-hack (set -U) for interactive shells
2006-11-12 10:44:42 +00:00
tg
56ffbf7e70
hand-sorted ctypes/chtypes upgrade; use table-driven where they make
...
sense and preprocessored otherwise; unify the logic
saves 144t 1i and lots of cpp(1) time, as well as improves readability
2006-11-10 07:52:04 +00:00
tg
feb7dddd44
* use only macros for ctype stuff any more
...
XXX one of these uses a gcc extension, ok for now tho
* don't include <ctype.h> any more at all
* don't try nl_langinfo in small mode, just check locale
saves 171 .text, 4 .data, 256 .bss, 1 import
2006-11-10 07:18:58 +00:00
tg
35b30679c7
since so many internal things hardcode 'C' locale anyway,
...
use own is{digit,lower,upper} macros that go via byte ranges
doesn't affect utf-8 hack because these only operate on single bytes anyway
saves 224t
2006-11-10 06:53:27 +00:00
tg
b323a22b59
use tolower_() and toupper_() macros (if not available, our quick 'C' ones)
...
76t 8d 2i
2006-11-10 06:45:28 +00:00
tg
a199d23dfa
use setresuid(2) and friends instead, saves 88t 4d 1i
...
XXX revisit this if we encounter systems without at least
XXX one of setresuid, setresgid, setgroups - only tested on BSD
2006-11-10 06:27:09 +00:00
tg
2342fa1242
don't use setreuid(2) etc. stuff, like OpenBSD
...
only affects suid shell scripts, which are *ugh* anyway,
and I really have no idea what the old code did, when, why, etc.
262t 16d 2i
2006-11-10 06:16:25 +00:00
tg
493ad928e3
if MKSH_SMALL, disable persistent history code as well (like on Solaris,
...
where it can't work anyway), and fix that code to shrink
saves 2071t 20d 5i
2006-11-10 05:23:14 +00:00
tg
d10dd31b9a
correct a few protos and comments
...
saves 4 .text bytes and my nerves
2006-11-10 03:45:57 +00:00
tg
f8e7fdbb71
use qsort(3) instead of rolling our own
...
saves 284 in .text, no added import since we already use qsort(3) once
2006-11-10 03:23:50 +00:00
tg
c60dbdc6cb
* change EXECSHELL to /bin/sh (we can override it via environment anyway,
...
and this is a sensible choice instead of ourselves)
* move this stuff from sh.h into exec.c where it belongs
* simplify set -o stuff
saves 8 bytes
2006-11-10 01:44:40 +00:00
tg
cd9202835c
cosmetics
2006-11-10 01:25:22 +00:00
tg
ebf58f6b42
if !MKSH_SMALL, str_save() can be a macro
2006-11-10 01:19:17 +00:00
tg
273ca89019
* check.t: add new regression test "typeset-padding-1" according to TFM
...
* edit.c: remove debug stuff again; next time better use shl.c functions ;)
* sh.h: add format attributes to a few shf functions
* histrap.c, var.c: fix format string mistakes
* main.c, sh.h: error_prefix and warningf take bool not int
* misc.c: make chvt() stuff use shf_* functions
* misc.c: rewrite the TIOCSTTY stuff to be better integrated in mksh,
since it originally was an external patch
* misc.c: chvt() no longer fails if e.g. chown fails due to e.g. R/O / fs
* var.c: fix typeset padding for right-justified zero-filled
2006-11-10 01:13:52 +00:00
tg
320f503391
get rid of ulton() - a joke
...
saves 32 bss, but adds 84 text oO
2006-11-09 23:55:52 +00:00
tg
88bf6422d9
shrink chtypes array down to 8 bit
...
saves 72 text and a lot bss
2006-11-09 23:39:16 +00:00
tg
3c33cbcecc
don't compile mknod(1) builtin if MKSH_SMALL
...
saves 1037 text, 20 data (on i386)
2006-11-09 22:18:10 +00:00
tg
2345d8b72b
more getconf/confstr fixes
2006-11-09 22:11:08 +00:00
tg
d4ca2c9141
simplify getconf and confstr stuff
2006-11-09 22:08:08 +00:00
tg
bc215df211
make a few functions static that should be, and optimise a little
2006-11-09 21:20:49 +00:00
tg
c43e701025
optional (#ifdef MKSH_SMALL) saving of 364 more bytes of .text
...
intended e.g. for FreeWRT
2006-11-09 21:00:13 +00:00
tg
35776a9d4d
using a function instead of a macro saves 896 bytes of .text
2006-11-09 20:53:42 +00:00
tg
617950554f
missed these
2006-11-09 15:03:56 +00:00
tg
36ac8dc0f7
get rid of the need of strlcat() altogether (only one use was left)
2006-11-09 15:02:31 +00:00
tg
2b375abef1
fix SIGSEGV, we are passed NULL sometimes
2006-11-09 14:58:27 +00:00
tg
a1bfc17aa0
optimise and, ahem… plug…
2006-11-09 14:19:31 +00:00
tg
39057dd592
add the new function utf_ptradj() which does the same as utf_widthadj()
...
except it doesn't return a value and is much cheaper (no internal con-
version to UCS-2, just range checking on the multibytes)
2006-11-09 00:39:27 +00:00
tg
0307ecb492
* instead of including <sys/cdefs.h> (not in Solaris), we hope <sys/types.h>
...
includes it for us
* autoconf-test for <sys/param.h> (not in SUSv3) existence
2006-11-09 00:11:39 +00:00
tg
d8de18df87
can use short form here
2006-11-08 23:50:47 +00:00
tg
11fbdb4378
implement autoconf tests for langstuff; sync date
2006-11-08 23:45:47 +00:00
tg
0e0782c856
first attempts at more autoconf'isation
2006-11-08 23:23:41 +00:00
tg
5e2e209d51
make this R29(beta), mksh -U turn on (or setlocale), and document.
2006-11-05 17:01:47 +00:00
tg
a373d2e7ab
first part of utf-8 ability in mksh, already works pretty well
2006-11-05 15:31:37 +00:00
tg
1547b04e66
add new "set -o utf8-hack", currently no effect
...
set automatically on startup if we have locale functions (on MirOS)
2006-11-05 12:11:14 +00:00
tg
02c14f2a62
use the same idstring stuff everywhere, makes sense
2006-10-03 19:46:14 +00:00
tg
fe3ada7780
sync with src/sys/sys/cdefs.h,v 1.11
2006-09-30 02:23:22 +00:00
tg
7ae68e335c
* avoid unaligned memory access causing SIGBUS on IA-64 (Itanic)
...
(incidentally, the information xor'd now is more random)
only affects non-arc4random targets
* bump version
2006-09-30 02:13:21 +00:00
tg
851e2d1bdb
pasto: forgot these
2006-09-21 22:05:46 +00:00
tg
3dd0c521d0
use the easier __RCSID() etc. stuff from current <sys/cdefs.h>
2006-09-21 22:03:23 +00:00
tg
33ddf84c63
bump version
...
our regression tests:
Total failed: 1 (as expected)
Total passed: 213
the IFS testsuite:
# tests 6856 passed 5192 failed 1664
2006-08-28 01:40:54 +00:00
tg
695503952f
use an autoconf-like approach to check for arc4random(3)
...
after gecko2 told me his mac recently has it and I found
out that Interix has it in -lcrypt and soon -lmirmake (:
2006-08-26 20:30:27 +00:00
tg
456bd584a3
bump version (hey, after all, I fixed the persistent history*!)
...
and that after submitting it to the FSF/UNESCO directory...
*) regression test for that? how?
2006-08-24 20:35:40 +00:00
tg
4fac7ec24b
* remove redundancy
...
* integrate compat.h, version.h into sh.h (dependency trick didn't work anyway)
* mention #ksh in mksh(1) since the founder (twkm) said it's on topic too
(don't remove mention of #mksh despite it's usually empty because of control)
2006-08-22 22:49:38 +00:00
tg
93ab969fdc
compat.h does have the status of a system header though...
2006-08-22 22:22:07 +00:00
tg
5b2be8517f
save more whitespace and make it compile again (oops)
2006-08-22 22:21:20 +00:00
tg
a87ff74cbd
* version.h doesn't need an RCS ID
...
* compat.h does, add it to misc.c, always include it, move if NEED_COMPAT
* major whitespace cleanup in sh.h
2006-08-22 22:16:04 +00:00
tg
11282be59d
compat.h has a section 'extra headers', move inttypes.h there
2006-08-16 00:00:24 +00:00
tg
98c4dc04a1
interix doesn't have <inttypes.h>, openbsd no <stdint.h>, the old chaos.
...
so add <inttypes.h> only for the one platform which needs it today, APE.
2006-08-15 23:54:09 +00:00