чување 50acc6280cd1049c8303f99cb922084dc082c817
родитељ ec7dcbd7a8efd148e7f7e487d65abda4748aaac5
Аутор: Страхиња Радић <contact@strahinja.org>
Датум: Tue, 26 Oct 2021 20:32:29 +0200
po.c: Avoid adding extra lines at the end of .po files
Signed-off-by: Страхиња Радић <contact@strahinja.org>
Diffstat:
измењених датотека: 2, додавања: 6(+), брисања: 2(-)
diff --git a/TODO b/TODO
@@ -9,6 +9,8 @@
[ ] Warn if Plural-Forms not present
[ ] Automatically add msgstr[] if nplurals>1
+ [x] Avoid adding extra lines at the end of file
+
< > Sort by flag/column?
diff --git a/po.c b/po.c
@@ -551,7 +551,8 @@ save_loop_entries_start:
if (current->obsolete)
{
- fprintf(output, "\n");
+ if (current < entries + real_msgid_count - 1)
+ fprintf(output, "\n");
current++;
goto save_loop_entries_start;
}
@@ -798,7 +799,8 @@ save_loop_entries_start:
fprintf(output, "msgstr \"\"\n");
}
- fprintf(output, "\n");
+ if (current < entries + real_msgid_count - 1)
+ fprintf(output, "\n");
current++;
goto save_loop_entries_start;
save_loop_entries_done: