Re: [MOD] STR #4033: _cupsMessageLookup() returns empty strings
Michael Sweet <[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 Closed w/Resolution] Fixed in Subversion repository. Link: http://www.cups.org/str.php?L4033 Version: 1.5.2 Fix Version: 1.6-current (r10318) _______________________________________________ cups-bugs mailing list [email protected] http://lists.easysw.com/mailman/listinfo/cups-bugs
str4033.patch
(text/plain, 988 B)
Index: cups/language.c
===================================================================
--- cups/language.c (revision 10317)
+++ cups/language.c (working copy)
@@ -938,8 +938,23 @@
*/
if (m)
- cupsArrayAdd(a, m);
+ {
+ if (m->str[0])
+ {
+ cupsArrayAdd(a, m);
+ }
+ else
+ {
+ /*
+ * Translation is empty, don't add it... (STR #4033)
+ */
+ free(m->id);
+ free(m->str);
+ free(m);
+ }
+ }
+
/*
* Create a new message with the given msgid string...
*/
@@ -1016,8 +1031,23 @@
*/
if (m)
- cupsArrayAdd(a, m);
+ {
+ if (m->str[0])
+ {
+ cupsArrayAdd(a, m);
+ }
+ else
+ {
+ /*
+ * Translation is empty, don't add it... (STR #4033)
+ */
+ free(m->id);
+ free(m->str);
+ free(m);
+ }
+ }
+
/*
* Close the message catalog file and return the new array...
*/