[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: SIGSEGV in msgmerge
From: |
Bruno Haible |
Subject: |
Re: SIGSEGV in msgmerge |
Date: |
Tue, 14 May 2002 19:21:06 +0200 (CEST) |
Jan-Marek Glogowski writes:
> When running msgmerge on the attached PO files I get a SIGSEGV.
>
> Version: 0.11.2
>
> Command: msgmerge de.old de.ref -o de.po
>
> I don't have time to investigate this problem, so I just attached
> a backtrace and the POs
Thanks a lot for the report. This patch fixes it. Changing the charset
field from iso9959-1 to the correct iso-8859-1 also avoids the problem.
Bruno
*** gettext-0/src/write-po.c 2002-04-27 12:36:39.000000000 +0200
--- gettext-1/src/write-po.c 2002-05-14 12:02:58.000000000 +0200
***************
*** 247,252 ****
--- 247,253 ----
enum is_wrap do_wrap;
const char *charset;
{
+ const char *canon_charset;
const char *s;
bool first_line;
#if HAVE_ICONV
***************
*** 255,260 ****
--- 256,263 ----
#endif
bool weird_cjk;
+ canon_charset = po_charset_canonicalize (charset);
+
#if HAVE_ICONV
/* The old Solaris/openwin msgfmt and GNU msgfmt <= 0.10.35 don't know
about multibyte encodings, and require a spurious backslash after
***************
*** 267,286 ****
/* Write a PO file in old format, with extraneous backslashes. */
conv = (iconv_t)(-1);
else
! /* Avoid glibc-2.1 bug with EUC-KR. */
! # if (__GLIBC__ - 0 == 2 && __GLIBC_MINOR__ - 0 <= 1) && !defined
_LIBICONV_VERSION
! if (strcmp (charset, "EUC-KR") == 0)
conv = (iconv_t)(-1);
else
# endif
! /* Use iconv() to parse multibyte characters. */
! conv = iconv_open ("UTF-8", charset);
if (conv != (iconv_t)(-1))
weird_cjk = false;
else
#endif
! weird_cjk = po_is_charset_weird_cjk (po_charset_canonicalize (charset));
/* Loop over the '\n' delimited portions of value. */
s = value;
--- 270,299 ----
/* Write a PO file in old format, with extraneous backslashes. */
conv = (iconv_t)(-1);
else
! if (canon_charset == NULL)
! /* Invalid PO file encoding. */
conv = (iconv_t)(-1);
else
+ /* Avoid glibc-2.1 bug with EUC-KR. */
+ # if (__GLIBC__ - 0 == 2 && __GLIBC_MINOR__ - 0 <= 1) && !defined
_LIBICONV_VERSION
+ if (strcmp (canon_charset, "EUC-KR") == 0)
+ conv = (iconv_t)(-1);
+ else
# endif
! /* Use iconv() to parse multibyte characters. */
! conv = iconv_open ("UTF-8", canon_charset);
if (conv != (iconv_t)(-1))
weird_cjk = false;
else
#endif
! if (canon_charset == NULL)
! weird_cjk = false;
! else
! weird_cjk = po_is_charset_weird_cjk (canon_charset);
!
! if (canon_charset == NULL)
! canon_charset = po_charset_ascii;
/* Loop over the '\n' delimited portions of value. */
s = value;
***************
*** 528,534 ****
/* Do line breaking on the portion. */
mbs_width_linebreaks (portion, portion_len, width, startcol, 0,
! overrides, charset, linebreaks);
/* If this is the first line, and we are not using the indented
style, and the line would wrap, then use an empty first line
--- 541,547 ----
/* Do line breaking on the portion. */
mbs_width_linebreaks (portion, portion_len, width, startcol, 0,
! overrides, canon_charset, linebreaks);
/* If this is the first line, and we are not using the indented
style, and the line would wrap, then use an empty first line