[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: $* and $@ broken on some (64 bit?) platforms in bash 3.1
From: |
Harald Koenig |
Subject: |
Re: $* and $@ broken on some (64 bit?) platforms in bash 3.1 |
Date: |
Mon, 27 Mar 2006 16:07:28 +0200 |
User-agent: |
Mutt/1.5.11 |
Hi again,
I've done some more testing -- but still I don't get the whole figure.
here are some more mosaic pieces for the jigsaw puzzle, maybe you know
what's going wrong here ?!
I've done some more compile tests mostly on HP-UX 11.11 (and 11.22).
my default build (which is broken) was with gcc used MULTIBYTE support.
trying to compile with system "cc" breaks because of broken wchar.h,
I need the following small patch
-------------------------------------------------------------------------------
--- orig/bash-3.1/config-bot.h 2004-03-19 23:56:23.000000000 +0100
+++ bash-3.1/config-bot.h 2006-03-27 15:18:33.000000000 +0200
@@ -139,6 +139,17 @@
# endif
#endif
+/* HAK: wchar.h is broken on HP-UX */
+#if defined (HAVE_WCHAR_H) && defined(__hpux__)
+#include <sys/_mbstate_t.h>
+size_t mbrlen(const char *s, size_t n, mbstate_t *ps);
+size_t wcsrtombs(char *dst, const wchar_t **src, size_t len, mbstate_t *ps);
+size_t wcrtomb(char *s, wchar_t wc, mbstate_t *ps);
+size_t mbrtowc(wchar_t *pwc, const char *s, size_t n, mbstate_t *ps);
+size_t mbsrtowcs(wchar_t *dst, const char **src, size_t len, mbstate_t *ps);
+#endif
+
+
/* If we don't want multibyte chars even on a system that supports them, let
the configuring user turn multibyte support off. */
#if defined (NO_MULTIBYTE_SUPPORT)
-------------------------------------------------------------------------------
but again this binary still is broken.
next I compiled with
#undef HANDLE_MULTIBYTE
at the end of config-bot.h. using system cc, the binary still shows the same
problems, but the "gcc" binary seems to be ok!!
using "#undef HANDLE_MULTIBYTE" on Mac OS X removes those problems too.
I've looked into the errors in output of "tests/run-test" using,
it's not the test itself which fails but argument passing
to the shell function:
./bash -c ' t() { test "$@"; echo -n "$@ $? "; } ; t -a noex ; test -a
noex2 ; echo $? '
correct output (cc no-MB):
-a noex 1 1
bad output:
-aÏÏnoex 0 1
^^
there are two 0xCF charaters after "-a" instead of the space.
or on Mac OS X with non-working HANDLE_MULTIBYTE :
-a-anoex 0 1
I don't really like the idea to disable HANDLE_MULTIBYTE on platforms
like HP-UX 11.11/22 or even Mac OS X -- there must be another solution ?!?!?
Harald Koenig
--
"I hope to die ___ _____
before I *have* to use Microsoft Word.", 0--,| /OOOOOOO\
Donald E. Knuth, 02-Oct-2001 in Tuebingen. <_/ / /OOOOOOOOOOO\
\ \/OOOOOOOOOOOOOOO\
\ OOOOOOOOOOOOOOOOO|//
Harald Koenig \/\/\/\/\/\/\/\/\/
science+computing ag // / \\ \
koenig@science-computing.de ^^^^^ ^^^^^