Commit Graph

603 Commits

Author SHA1 Message Date
tg
c942031805 mark the test that fails ifdef MKSH_SMALL as category:pdksh too,
so people can skip it if they build a small one
2006-11-10 06:18:05 +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
27443bc0c8 skip on cesu-8, we think nl_langinfo(CODESET) at least will
always return utf-8 for it (on wchar_t=16bit systems); 68t
2006-11-10 05:27:43 +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
7c4f8d7e16 oops 2006-11-10 05:21:38 +00:00
tg
d5e4c261db simplify. and, a few byte compares are cheaper than a structure
copy and a structure compare
gain: 103t 4d 1i
loss: had to move some code even though no diff (cvs issue)
2006-11-10 04:31:04 +00:00
tg
208c45da25 more cleanup; incidentally, replacing libc function with syscall maybe speedup
9t 4d 1i
2006-11-10 04:22:13 +00:00
tg
5dff5df5e5 get rid of the 'mksh -T' functionality (chvt) if MKSH_SMALL
848 text 12 data 3 imports
2006-11-10 04:07:59 +00:00
tg
a1ff719ba4 thanks to the nice property of my reimplementation of getn to also
return a value in case of an error (0 or the partial result, which
is the full result in case of trailing junk even), using it to rid
atoi() is possible, saving 9t 4d 1i
2006-11-10 04:03:59 +00:00
tg
d91d7feff0 exit not _exit, 50 text 4 data 1 import 2006-11-10 03:54:38 +00:00
tg
ecc08e9681 use chown not fchown, and move the ownership check to earlier
saves 45 text, 4 data and security peoples' nerves
2006-11-10 03:50:05 +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
f103c6b2a0 use errorf not bi_errorf if we want to abort
saves 16 .text ;)
2006-11-10 02:10:45 +00:00
tg
658dc2b407 rewrite getn() which is some kind of atoi with return code
costs 1 .text, saves 4 .data, 1 libc import
2006-11-10 02:05:06 +00:00
tg
242d2c086d overhaul parse_args - don't use strlcpy and strlen when overkill
also fixes off-by-one

saves 48 .text
2006-11-10 01:52:23 +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
f1e29cb1a1 use NELEM 2006-11-10 01:24:38 +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
c2aec39358 save 176 text (92 text 32 bss relative to before last commit)
by making correct use of shf_* functions
2006-11-10 00:09:27 +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
6334091d86 omit usage msg if small 2006-11-09 23:19:52 +00:00
tg
625928f9f1 make autoconf checks more verbose as well 2006-11-09 23:09:05 +00:00
tg
e49b50f8f1 check for a few more things 2006-11-09 23:04:34 +00:00
tg
7148a691e0 simplify 2006-11-09 22:56:55 +00:00
tg
ee55f29a31 new function ac_testn() does the same as ac_test() but doesn't amend CPPFLAGS 2006-11-09 22:56:09 +00:00
tg
2bdcd71ef0 unbreak -d (was broken in R28) 2006-11-09 22:53:21 +00:00
tg
a48a880c00 ac_test for MKSH_SMALL presence in CPPFLAGS
if present, don't even look for setmode as it's only used by mknod builtin
2006-11-09 22:51:49 +00:00
tg
68caa9afdd save 464 text with restructuring 2006-11-09 22:38:31 +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
fb9c6e30bb fix another warning
now builds on MirOS, DragonFly, NetBSD, Debian stale (i386), Solaris 8,
Debian testing (s390x) - Solaris /bin/sh, bash, ksh93, mksh
2006-11-09 00:28:36 +00:00
tg
1ffa722d73 optic sugar 2006-11-09 00:13: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
9b0dbaddbf oops, missed syntactic change 2006-11-09 00:08:25 +00:00
tg
1c7e58a9d9 use \u0060...\u0060 instead of $(...)
demanded by solaris /bin/sh
2006-11-09 00:06:33 +00:00
tg
84088b91d0 there is no compat.c any more 2006-11-09 00:03:37 +00:00
tg
dc9f457f24 don't use __predict_false() here either 2006-11-09 00:01:36 +00:00