Commit Graph

1177 Commits

Author SHA1 Message Date
tg 667f309387 support arc4random.c in build but not src dir, too 2008-06-29 19:46:56 +00:00
tg 941d228f99 some basic LLVM+clang (with “ccc” driver example) support 2008-06-29 18:18:56 +00:00
tg d20bb52049 remove llvm-clang artefacts in more places 2008-06-29 18:08:55 +00:00
tg edb83bf872 remove a.out.s and a.out.bc (llvm-clang fallout) too 2008-06-28 23:00:43 +00:00
tg c77d67ef4d • add code to support GNU bash’s “&> file” I/O redirection extension,
and make it fit into mksh’s model (also gives us a couple of things
  GNU bash doesn’t have
• add regression tests for all of these

Lukas “smultron” Upton from MidnightBSD spotted a script with /bin/sh
shebang invalidly using “&>” in some Apple backup toolkit, 10x

XXX why fds are limited to one digit?
2008-06-28 22:51:56 +00:00
tg fcb931ae2e more safe idiom 2008-06-28 22:01:44 +00:00
tg 1863471854 improve Mac OSX version reporting 2008-06-22 20:51:31 +00:00
tg 9fabfb278f SUNw,cc is one of the compilers whose version reporting works better when
compiling a demo programme at the same time
2008-06-21 19:38:41 +00:00
tg a89db7b95b Darwin also has other locale 2008-06-21 19:30:49 +00:00
tg 5d73013c02 remove check_category “pdksh”, it starts to make trouble and was never
taken seriously anyway, just historic ballast
2008-06-21 19:20:15 +00:00
tg 419600db62 fix the RCS IDs 2008-06-08 17:16:25 +00:00
tg 18bbd23397 • more usage fixes, inspired by sobrado
• bump mksh patchlevel
2008-06-08 17:15:30 +00:00
tg 399157adcc cast two pointer arithmetics to ptrdiff_t
commit inspired by fgsch:
> Log message:
> cast pointer arithmetic to unsigned so we can behave correctly on
> underflows. fixes fc -l 1 in my box where line is 1667511151.
> krw@ ok.

  to signed rather. oops.
2008-06-08 17:14:31 +00:00
tg e91eab65a8 sort argument list, inspired by commit from Igor Sobrado 2008-06-08 16:57:52 +00:00
tg e0e0876e7e fix regression test: Solaris has $^O solaris not sunos, and locales of
the style xx.UTF-8 not xx.utf8, so just split the test into two
2008-06-02 20:44:07 +00:00
tg f7d5a16363 What is valid for Build.sh should be valid for test.sh too.
In this case: reset the locale to “C” at start.
Otherwise, perl/OpenBSD fails in an UTF-8 environment, just
because OpenBSD 4.3/zaurus still has no locales in 2008.
2008-05-20 18:47:06 +00:00
tg 6eea28c1f3 I’m sorta shocked… 2008-05-17 20:10:52 +00:00
tg 72f9cf1c9b optimise based upon the following assumption:
• my_pid = getpid(); setpgid(0, my_pid);
• if it hasn’t failed, the following is true: getpgrp() == my_pid

at least this is what I gather from TFM and the kernel source
waldi _thinks_ so, too
2008-05-17 19:03:25 +00:00
tg f17b8b1c8b • alloc() can’t fail, afree() can take NULL
‣ macro afreechk() is superfluous
• get rid of macro afreechv() by re-doing the “don’t leak that much” code
• some KNF (mostly, whitespace and 80c) while here
2008-05-17 18:47:03 +00:00
tg b41a72ac2e add new builtin “realpath” calling realpath(3) on its argument, skipping
over “--” for compatibility to Debian realpath(1) and possibly busybox’

“sounds handy” replaced@TNF
2008-05-17 18:27:57 +00:00
tg b40ba2c8d1 beauty error: clear LDFLAGS and LIBS while using -c 2008-05-17 18:19:11 +00:00
tg 4e4ede2442 fix for $HOME with trailing slash (do not expand then either… we could just
strip it, but that might have other problems, better is to use realpath(2),
e.g. via readlink(1), for normalisation, or have the sysop fix it)

XXX make realpath a builtin?
2008-05-16 22:22:11 +00:00
tg 8cf7c94908 if $HOME is / or empty, bash-style tilde replacement yielded funny results 2008-05-16 22:19:11 +00:00
tg 6be5205b36 mksh:
* initialise the integers PPID, OPTIND, RANDOM, SECONDS, and TMOUT to base-10
* bring back PGRP as base-10 integer to the process group via getpgrp(2)
* initialise USER_ID as base-10 integer to the effective user id as retrieved
  from geteuid(2) = $(id -u)
* use $USER_ID in dot.mkshrc instead of spawning an id(1) process
  -> dot.mkshrc,v 1.34 now requires mksh R34
* convert more int to bool where appropriate
* remove dead code - getpgrp(2) cannot fail
* sync manual page to reality
* bump to mksh R34(beta) - feature freeze

XXX check if our_pgrp in jobs.c is still really needed, the setpgid call
XXX probably just makes us our own pgrp leader, and we might have to use
XXX and update kshpgrp accordingly - need feedback/help here but I think
XXX this simplification should be possible if I grok the code correctly.

etc/profile:
* adjust to $USER_ID changes in mksh (speed-up here, too)

mksh.hts:
* sync changelog
2008-05-15 15:24:11 +00:00
tg 67b4dc8731 * default to no setlocale for a couple more platforms
* default to UTF-8 on Plan 9
2008-05-13 00:08:12 +00:00
tg 512bee8c32 • GNU/Cygwin has, according to G**gle, only stubbed locale support, like
OpenBSD
• update testsuite results and clog, again
2008-05-11 14:47:04 +00:00
tg 4e53710a01 NUL bytes don’t work 2008-05-10 18:10:02 +00:00
tg f6b7a09146 • on OpenBSD, default to HAVE_SETLOCALE_CTYPE=0… I wonder if that’ll ever
change – this might affect other OSes too in time for R34
• one of the regression tests had an unexpected failure if running as root
• www: sync clog; log newer mksh built on newer OpenBSD works fine
2008-05-10 03:16:07 +00:00
tg 7a06275658 shrink code size for a corner case 2008-05-04 02:02:32 +00:00
tg 06ff8540a0 remove more dead mirtoconf code 2008-05-04 01:59:46 +00:00
tg c5db7903dd if we don't have setlocale(), just look at the env vars ourselves 2008-05-04 01:58:15 +00:00
tg 604ec0ff6c remove dead code and ifdefs, speed up configuring 2008-05-04 01:51:31 +00:00
tg fed038354d this test even works with the defutf8 mkshen as the shell is !interactive 2008-05-04 01:39:12 +00:00
tg 3a9febd94d HP-sUX has en_US.utf8 but no en_US.UTF-8
as GNU has both, and I don’t know which OS has what and which is more
common, just use that one instead
2008-05-04 01:38:04 +00:00
tg e27ae086d2 set the "C" locale during runs… otherwise, some OSes’ tr(1) or so might
act strange… 10x Adam “replaced” Hoka for helping to find this
00:51⎜<replaced_> it needs -A
00:52⎜<mirabilos> heh. locale?
00:52⎜<replaced_>            -A             Translates on a byte-by-byte basis. When this flag
00:52⎜<replaced_>                           is specified tr does not support extended
00:52⎜<replaced_>                           characters.
00:52⎜<replaced_> LC_CTYPE=en_US.utf8
00:52⎜<mirabilos> hmmm
00:52⎜<mirabilos> but that is weird too
00:52⎜<mirabilos> I don't see why it shouldn't work
00:52⎜<replaced_> yeah, it should act the same
00:53⎜<mirabilos> try this please:
00:53⎜<mirabilos> without -A
00:53⎜<mirabilos> echo sys/param.h | env LC_ALL=C /bin/tr -c
     ⎜    qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM0123456789
     ⎜    ______________________________________________________________
00:53⎜<replaced_> this works of course
2008-05-04 00:55:18 +00:00
tg 4230cf91de thinko: multibyte characters are not always 1 column wide 2008-05-02 18:55:37 +00:00
tg 1ed64c3e26 bump 2008-04-22 19:00:41 +00:00
tg 7b645a40c3 remove the now-unused addition to the ksh_getopt() code
which oksh used for their ulimit change, as I’m not going
to hack on it for now… maybe editing the optstring as it
is parsed (in the first loop), but… naah, not now
2008-04-22 19:00:01 +00:00
tg 677875771e take most of the goodies of the recent c_ulimit() changes, but retain the
old way of working (also add some more casts and simplify the code)
2008-04-22 18:58:20 +00:00
tg a3dab099d9 sh.h can provide its rcsid itself, no need for that ugly hack 2008-04-22 18:57:26 +00:00
tg e57f5fc09b • be friendlier to AT&T ksh: use only signed (standard) integers
‣ now, a “ksh93” just requires ‘function precmd { :; }; set -o emacs’
    afterwards to get rid of the annoying error messages
  ‣ I could lose that with the following idiom:
    - PS1='$(precmd)…
    + PS1='$(typeset -i e=$?; typeset -f precmd >&- && { (return $e); precmd })…
    but it didn’t seem worthwhile to me
• remove explicit licence blah, normal ./copyright applies
2008-04-22 13:48:15 +00:00
tg 487da1357e remove advertising clause from mksh distribution: while I’d still prefer
when people mention that their product includes mksh, I won’t enforce to
have them advertise with my name… this should make things easier
2008-04-22 11:47:57 +00:00
tg 7dd741a401 • revert the oksh code to be able to set multiple ulimits in one
invocation, until it works with a common idiom: “ulimit -dS 262144”
  (but keep some goodies)
• add a regression test for that
2008-04-20 21:30:29 +00:00
tg d6f3f726a6 clean up unused defines 2008-04-20 02:15:12 +00:00
tg a96b40067b sync with updated libc functions 2008-04-20 02:01:42 +00:00
tg c21dd61fd3 make it clearer (and most people don’t know what CESU-8 is, anyway) 2008-04-20 01:47:59 +00:00
tg 5fb55148a1 merge the fix for that segfault 2008-04-20 01:41:57 +00:00
tg 8c41fbed15 this example shows how to really do a hexdump parser in unicode mode (safe)
→ this isn’t recommended however
2008-04-20 01:23:49 +00:00
tg c312619cc9 ok, so instead of removing the “-o utf8-hack” behaviour of the 1#* operator
we just tell the user to only throw valid CESU-8 or single octets on it
2008-04-20 01:12:52 +00:00
tg f80424e92e even like this, handling mis-formed UTF-8 is kind of impossible…
except we duplicate all of the logic
2008-04-20 00:56:17 +00:00