diff options
author | xhe <xw897002528@gmail.com> | 2018-12-27 20:10:45 +0800 |
---|---|---|
committer | rofl0r <retnyg@gmx.net> | 2019-01-16 02:38:18 +0000 |
commit | a0878eecc516545ef04d5d73bd6858c0d8e4f661 (patch) | |
tree | 5a69fabca0ca8385d0a92798c631367c4c9c5f7e | |
parent | 949a6f2dc28f26d84b28a97f6405a7a23121a68e (diff) | |
download | gettext-tiny-a0878eecc516545ef04d5d73bd6858c0d8e4f661.tar.gz |
poparser: disable 'first' flag after a msgblock
there're two points:
1. only disable 'first' flag at parse stage. but i want it same at both
two stages when i tried to invoke this flag.
2. disable 'first' flag once after poparser_feed_hdr() was finished.
i originally assume it's consistent in the parse process of a whole
block. this is causing 'msgstr abort', because there's a syntax check
relying on this flag. so now, it keeps consistent in the whole process.
-rw-r--r-- | src/poparser.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/poparser.c b/src/poparser.c index 372f544..64be654 100644 --- a/src/poparser.c +++ b/src/poparser.c @@ -73,8 +73,6 @@ static inline enum po_error poparser_feed_hdr(struct po_parser *p, po_message_t if ((x = strstr(msg->str[0], "nplurals="))) { p->hdr.nplurals = *(x+9) - '0'; } - - p->first = false; } return po_success; @@ -88,6 +86,8 @@ static inline enum po_error poparser_clean(struct po_parser *p, po_message_t msg } if (p->strcnt) { + if (p->first) p->first = false; + msg->strlen[p->strcnt] = 0; // PO_SYSDEP_PRIUMAX == 0, it has no effects to our codes |