[MOD] STR #4033: _cupsMessageLookup() returns empty strings

Jiri Popelka <[email protected]>
Newsgroups gmane.comp.printing.cups.bugs
Message-ID <[email protected]>
DO NOT REPLY TO THIS MESSAGE.  INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.

[STR New]

Hi,

_cupsMessageLookup() function should return the original/untranslated
string if the translated string is empty.

Because there are many untranslated (translated as "") strings in
cups-1.5.2/locale/cups_<lang>.po
this bug causes that for example 'lpstat -t' shows bunch of empty lines
with locale set to one of the <lang> from locale/cups_<lang>.po

--
Jiri

Link: http://www.cups.org/str.php?L4033
Version: 1.5.2

_______________________________________________
cups-bugs mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/cups-bugs
cups-1.5.2-translation.patch (text/plain, 775 B)
diff -up cups-1.5.2/cups/language.c.translation cups-1.5.2/cups/language.c
--- cups-1.5.2/cups/language.c.translation	2011-11-01 07:06:15.000000000 +0100
+++ cups-1.5.2/cups/language.c	2012-02-28 11:08:34.858537508 +0100
@@ -1085,7 +1085,8 @@ _cupsMessageLookup(cups_array_t *a,	/* I
 
 
  /*
-  * Lookup the message string; if it doesn't exist in the catalog,
+  * Lookup the message string;
+  * if it doesn't exist in the catalog or the translated string is empty,
   * then return the message that was passed to us...
   */
 
@@ -1134,7 +1135,7 @@ _cupsMessageLookup(cups_array_t *a,	/* I
   }
 #endif /* __APPLE__ && CUPS_BUNDLEDIR */
 
-  if (match && match->str)
+  if (match && match->str && strlen(match->str) > 0)
     return (match->str);
   else
     return (m);
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.