while (cupsFileGets(po, s, sizeof(s)) != NULL)
{
- if ((s[0] == '#' && s[0] != '.') || !s[0])
+ if (s[0] == '#' && s[1] == '.')
{
/*
- * Skip blank and file comment lines...
+ * Copy comment string...
*/
- continue;
+ if (msgid && msgstr)
+ {
+ /*
+ * First output the last localization string...
+ */
+
+ if (*msgid)
+ cupsFilePrintf(strings, "\"%s\" = \"%s\";\n", msgid,
+ (use_msgid || !*msgstr) ? msgid : msgstr);
+
+ free(msgid);
+ free(msgstr);
+ msgid = msgstr = NULL;
+ }
+
+ cupsFilePrintf(strings, "//%s\n", s + 2);
}
- else if (s[0] == '#')
+ else if (s[0] == '#' || !s[0])
{
/*
- * Copy comment string...
+ * Skip blank and file comment lines...
*/
- cupsFilePrintf(strings, "//%s\n", s + 2);
+ continue;
}
else
{
if (msgid && msgstr)
{
if (*msgid)
- cupsFilePrintf(strings, "\"%s\" = \"%s\";\n\n", msgid,
+ cupsFilePrintf(strings, "\"%s\" = \"%s\";\n", msgid,
(use_msgid || !*msgstr) ? msgid : msgstr);
free(msgid);
if (msgid && msgstr)
{
if (*msgid)
- cupsFilePrintf(strings, "\"%s\" = \"%s\";\n\n", msgid,
+ cupsFilePrintf(strings, "\"%s\" = \"%s\";\n", msgid,
(use_msgid || !*msgstr) ? msgid : msgstr);
free(msgid);