From: Vin Shelton <shelton@icd.teradyne.com>
To: Oliver Kiddle <okiddle@yahoo.co.uk>
Cc: Zsh hackers list <zsh-workers@sunsite.dk>
Subject: Re: 'make check' failures on Solaris 2.5 and 5.8
Date: Tue, 18 Mar 2003 09:10:55 -0500 [thread overview]
Message-ID: <545y93crci8.fsf@icd.teradyne.com> (raw)
In-Reply-To: <5757.1047989340@finches.logica.co.uk> (Oliver Kiddle's message of "Tue, 18 Mar 2003 13:09:00 +0100")
Oliver Kiddle <okiddle@yahoo.co.uk> writes:
> Vin Shelton wrote:
>> Sorry to followup my own post, but I forgot to mention that the
>> failures started appearing on 2003-03-14. My 2003-03-13 build passed
>> 'make check' fine, except for the expected C02cond failure.
>
> That narrows it down to being my fault in the \u/\U change. Thanks for
> reporting it.
>
> The problem is that MB_LEN_MAX is less than 6 on Solaris so it wasn't
> allocating enough memory. UTF-8 has characters up to 6 bytes in length
> so this suprised me. Solaris 8 pretends to offer UTF-8 locales but I
> can't get them to work. The patch below is a quick fix. MB_LEN_MAX is
> defined to be 16 in recent glibc which seems high. Anyone know why or
> what character sets need that? Handling of $'...' will need rethinking if
> '\unnnn' can produce more than 6 bytes because $'...' is done by modifying
> the string in place.
>
> If anyone has access to any operating systems other than Linux
> and Solaris 8, it would be really useful to know whether it defines
> __STDC_ISO_10646__, the value of MB_LEN_MAX and, even more valuably, what
> iconv conversions it allows. iconv doesn't necessarily use the same names
> for character sets as nl_langinfo(CODESET). unicode can be ISO-10646,
> ISO646, 646, UCS4 and other variants so I perhaps should manually convert
> to UTF-8 as that has fewer names and then try converting to WCHAR_T and
> then nl_langinfo(CODESET).
>
> Oliver
>
> Index: utils.c
> ===================================================================
> RCS file: /cvsroot/zsh/zsh/Src/utils.c,v
> retrieving revision 1.45
> diff -u -r1.45 utils.c
> --- utils.c 14 Mar 2003 13:36:16 -0000 1.45
> +++ utils.c 18 Mar 2003 11:33:59 -0000
> @@ -3311,15 +3311,12 @@
> char *inptr, *outptr;
> # endif
> size_t count;
> - size_t buflen = MB_LEN_MAX * (strlen(s) / 6) + (strlen(s) % 6) + 1;
> -#else
> - size_t buflen = strlen(s) + 1;
> #endif
>
> if (fromwhere == 6)
> t = buf = tmp;
> else if (fromwhere != 4)
> - t = buf = zhalloc(buflen);
> + t = buf = zhalloc(strlen(s) + 1);
> else {
> t = buf = s;
> s += 2;
>
Oliver,
Your quick fix solved my 'make check' problems on both Solaris 5.5 and
5.8.
Thanks,
Vin
next prev parent reply other threads:[~2003-03-18 14:11 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-03-17 17:42 Vin Shelton
2003-03-17 17:50 ` Vin Shelton
2003-03-18 12:09 ` Oliver Kiddle
2003-03-18 14:10 ` Vin Shelton [this message]
2003-03-17 20:47 ` Bart Schaefer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=545y93crci8.fsf@icd.teradyne.com \
--to=shelton@icd.teradyne.com \
--cc=okiddle@yahoo.co.uk \
--cc=zsh-workers@sunsite.dk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).