summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorxhe <xw897002528@gmail.com>2018-12-27 20:40:56 +0800
committerrofl0r <retnyg@gmx.net>2019-01-16 02:38:18 +0000
commit8aeb6cd875c13cbb2ca0e0d9900f68216878b06a (patch)
tree01e8ba5c2909b38892ee06d6db2cd07531ca8d0d
parent5a06a817db832dfa82fc79715aecdfa783f29dc7 (diff)
downloadgettext-tiny-8aeb6cd875c13cbb2ca0e0d9900f68216878b06a.tar.gz
poparser: comment may start a new block too
i assume a block is completely parsed just before next msgid/ctxt. but the reality is comment may start a new block too. and if poparser dont treat comments as the start of new block, those comments will be parsed into as flags of old block.
-rw-r--r--src/poparser.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/poparser.c b/src/poparser.c
index 7b58a1d..817bf76 100644
--- a/src/poparser.c
+++ b/src/poparser.c
@@ -132,6 +132,11 @@ enum po_error poparser_feed_line(struct po_parser *p, char* in, size_t in_len) {
// ignore blank lines
return po_success;
} else if (line[0] == '#') {
+ if (p->previous == po_str) {
+ if ( (t = poparser_clean(p, msg)) != po_success)
+ return t;
+ }
+
switch (line[1]) {
case ',':
x = &line[2];