Could this be related to this bug that I found in GTk+ in November. 

 Tue Nov 16 10:15:54 1999 Owen Taylor <[EMAIL PROTECTED]>

 * gtk/gtkitemfactory.c (gtk_item_factory_parse_path):
 If translation does not include a '/', use entire
 translation instead of crashing.

(That was after GTK+ 1.2.6 was released.)

    From: Owen Taylor <[EMAIL PROTECTED]>
    To: Tor Lillqvist <[EMAIL PROTECTED]>
    Subject: Re: gtk_item_factory_parse_path() problem with incorrect translations
    Date: 16 Nov 1999 10:30:51 -0500

    Tor Lillqvist <[EMAIL PROTECTED]> writes:

    > Hi,
    > There is a problem with gtk_item_factory_parse_path() if it encounters
    > a bogus translation string (typically one of those fuzzy translations
    > I assume the gettext tools generate as more or less pathetic
    > guesstimates by themselves?). If the translation doesn't contain any

    Hmmm, but fuzzy matches are disabled by default until someone hand-edits
    them in...

    > slash, the code at the end of gtk_item_factory_parse_path() obviously
    > will crash.  This can be demonstrated by running the GIMP with
    > LANG=ru, for instance.
    > It might be argued that translations are supposed to be correct, and
    > that crashing is thus OK? Anyway, suggested fix below.

    Hmmm, sort of embarassing. I've been saying for a long time that
    the translations do _not_ need to contain the full path, since
    everything but the last component is simply ignored.

    So, the change that makes it do what I thought it was doing is:

    Index: gtkitemfactory.c
    RCS file: /cvs/gnome/gtk+/gtk/gtkitemfactory.c,v
    retrieving revision
    retrieving revision
    diff -u -r1.21.2.5 -r1.21.2.6
    --- gtkitemfactory.c        1999/10/07 21:29:41
    +++ gtkitemfactory.c        1999/11/16 15:25:48
    @@ -968,7 +968,10 @@
         translation = str;

       p = strrchr (translation, '/');
    -  p++;
    +  if (p)
    +    p++;
    +  else
    +    p = translation;

       *item = g_strdup (p);

    Thanks for pointing this out,

Reply via email to