bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: gettext .mo files and nullentry


From: Bruno Haible
Subject: Re: gettext .mo files and nullentry
Date: Sun, 29 Aug 2010 11:36:05 +0200
User-agent: KMail/1.9.9

Hi,

Joachim Metz wrote:
> I'm currently looking into .mo files and was missing information about
> the nullentry in the documentation.
> Mainly the required and optional entries, e.g. 'Content-Type:' with a
> 'charset=' seems required.
> Could you update the documentation.

The documentation is already present in
  <http://www.gnu.org/software/gettext/manual/html_node/Header-Entry.html>

> Looking at the libintl-0.14.4 code I found that libintl has a logical
> error (the same error consists in glibc 2.9).
> libintl searches for the 'charset=', 'nplural=' and 'plural='
> sub-string in the nullentry, but it fails to check if the definition
> (line) they are in are the right one, e.g. if they start with
> 'Content-Type:' or 'Plural-Forms:'.

True, it does not do this check, but this is not a problem, because these
markers charset=, plural=, nplurals= make no sense in another other part
of the header.

> The plural form parser (plural.y) does not check for an upper bound of
> numeric values.
> line 257 in plural.y

This too is not a problem, because
  1. the computations are done with 'unsigned long', which wraps around
     mod 2^32 or 2^64 upon overflow (no abort()),
  2. nothing bad happens if the plural formula and nplurals value have
     definitions which make no sense (e.g. "plural=(n+100000000000000)").

Bruno



reply via email to

[Prev in Thread] Current Thread [Next in Thread]