summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorxhe <xw897002528@gmail.com>2017-07-20 17:14:54 +0800
committerxhe <xw897002528@gmail.com>2017-07-20 18:10:57 +0800
commitd7800312c4d4624b7c7fa9bc0496585967db5134 (patch)
tree3923a200292b5c3034f734be9b335b97b566f289
parent7b4e3d16ce156aaf1909d2f8a2fac891b4cbc99f (diff)
downloadgettext-tiny-d7800312c4d4624b7c7fa9bc0496585967db5134.tar.gz
fix: checking the correct flag
found when compiling git/vi.po writestr() was executed twice due to depend on the wrong flag, this could be fixed by checking 'i'. 'i' will be 0 for at least and only one time which is suitable in case.
-rw-r--r--src/msgfmt.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/msgfmt.c b/src/msgfmt.c
index 3b7e2a3..2dfb3da 100644
--- a/src/msgfmt.c
+++ b/src/msgfmt.c
@@ -318,9 +318,9 @@ int process_line_callback(struct po_info* info, void* user) {
l = strlen(sysdeps[i]);
assert(l+1 <= d->maxlen);
if(info->type == pe_msgid) {
- // after str, it's msgid or msgctxt
- if(d->milen1)
+ if(i==0 && d->milen1)
writestr(d, info);
+
// just copy, it's written down when writemsg()
if(i==0) {
memcpy(d->msgidbuf1, sysdeps[i], l+1);