diff options
author | xhe <xw897002528@gmail.com> | 2017-05-19 23:01:18 +0800 |
---|---|---|
committer | xhe <xw897002528@gmail.com> | 2017-05-19 23:06:30 +0800 |
commit | 51e0b73e0e63103582a3c30d1e583f7d93b99939 (patch) | |
tree | cb772f5b54faabc8afad671934816ae52294d024 | |
parent | 7409501c4cdd4c8d89e6898405816c636a129dc7 (diff) | |
download | gettext-tiny-51e0b73e0e63103582a3c30d1e583f7d93b99939.tar.gz |
fix to the mistmatch check:
though num[str] is allowed to be a little smaller than the maxium value, but it's not allowd to be smaller than num[msgid], which is the minimum value
-rw-r--r-- | src/msgfmt.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/msgfmt.c b/src/msgfmt.c index cc55837..e4fe364 100644 --- a/src/msgfmt.c +++ b/src/msgfmt.c @@ -409,7 +409,7 @@ int process(FILE *in, FILE *out) { if(d.pass == pass_second) { // start of second pass: // check that data gathered in first pass is consistent - if((d.num[pe_msgid] + d.num[pe_plural] * (p->info.nplurals - 1)) < d.num[pe_msgstr]) { + if((d.num[pe_msgstr] < d.num[pe_msgid]) || (d.num[pe_msgstr] > (d.num[pe_msgid] + d.num[pe_plural] * (p->info.nplurals - 1)))) { // one should actually abort here, // but gnu gettext simply writes an empty .mo and returns success. //abort(); |