summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorxhe <xw897002528@gmail.com>2017-12-09 23:54:13 +0800
committerxhe <xw897002528@gmail.com>2017-12-10 00:03:19 +0800
commit63a947ac5b0dc69e86ee6faf76c65f244a5939c6 (patch)
treef6fcbf60f2f5224e51bfa2927f461de0b29c5314
parent2941a9c1cbc8c6ffa40c9a60473ef3dfa8d1392e (diff)
downloadgettext-tiny-63a947ac5b0dc69e86ee6faf76c65f244a5939c6.tar.gz
poparser: ignore the invalid after comments
when compiling gdk-pixbuf 2.36.11, msgfmt segfaulted because poparser went though a situation where: ``` msgstr[1] "" "ssss "vvvv ``` In case, it extracted the string ' "ssss" ' and see the remaining part ' vvvv ' as the invalid, there's no wrong with the logic itself. But i wonder if we could just be generous with these merged strings generated by xgettext. If we insist on correctness everytime po files are updated by xgettext, we may meet numbers of abort(). Seeing gnu one ignoring these obvious invalid lines, i made this commit to provide a more smooth user experience.
-rw-r--r--src/poparser.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/poparser.c b/src/poparser.c
index 9f10755..faf7e27 100644
--- a/src/poparser.c
+++ b/src/poparser.c
@@ -162,11 +162,11 @@ int poparser_feed_line(struct po_parser *p, char* line, size_t buflen) {
[pe_invalid] = la_proc,
},
[pe_invalid] = {
- [pe_str] = la_abort,
+ [pe_str] = la_nop,
[pe_msgid] = la_incr,
[pe_ctxt] = la_incr,
- [pe_plural] = la_abort,
- [pe_msgstr] = la_abort,
+ [pe_plural] = la_nop,
+ [pe_msgstr] = la_nop,
[pe_invalid] = la_nop,
},
};