чување 1e028329110c7d95b88f2608c3b605253b711349
родитељ 030fe558d1eaa60bcdaacac1f7eda82a23ad425d
Аутор: Страхиња Радић <contact@strahinja.org>
Датум: Fri, 24 Dec 2021 21:04:14 +0100
Fix: When saving a msgstr, additional \n was added
Signed-off-by: Страхиња Радић <contact@strahinja.org>
Diffstat:
измењених датотека: 2, додавања: 6(+), брисања: 4(-)
diff --git a/TODO b/TODO
@@ -1,9 +1,9 @@
TODO
====
- [ ] Wrap long msgids/msgstrs when saving
- [ ] Transition to u32_next_line
- [ ] Fix: When saving a msgstr, \n gets added (check
+ [~] Wrap long msgids/msgstrs when saving
+ [~] Transition to u32_next_line
+ [x] Fix: When saving a msgstr, \n gets added (check
nlines)
[ ] Convert po.c:save_file to u32_next_line (currently
deletes all strings!)
@@ -22,3 +22,4 @@
[x] = fully done
[/] = eventually decided not to do
+
diff --git a/util.c b/util.c
@@ -321,7 +321,8 @@ u32_lines_in_string(const uint32_t* s, const size_t wrap)
while (*ps)
{
u32_next_line(s, &ps, wrap);
- result++;
+ if (*ps)
+ result++;
}
return result;
}