From 63a947ac5b0dc69e86ee6faf76c65f244a5939c6 Mon Sep 17 00:00:00 2001 From: xhe Date: Sat, 9 Dec 2017 23:54:13 +0800 Subject: 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. --- src/poparser.c | 6 +++--- 1 file 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, }, }; -- cgit v1.2.1