Hello, Andreas Stricker <astric...@futurelab.ch> writes:
> I can reproduce this with Debian testing default xgettext. But it > doesn't look Javascript specific. e.g. if I create two identical > files 1.c and 2.c with the content: > > int a() { ngettext("bla", 1); } > > And call it like this: > > xgettext --keyword=ngettext:1,1 -o - 1.c 2.c > > *** Error in `xgettext': double free or corruption (fasttop): > 0x0000000001428470 *** > > I'm not sure if this keyword argument is valid, but at least > it should not die like this. Thanks for the report and investigation. It seems to be a long-standing bug since 0.18, after this change: http://git.savannah.gnu.org/cgit/gettext.git/commit/?id=6aa7b7ed I'm not sure if this change is intentional nor what's the best way to handle this use-case, but here is a patch to recover the original behavior.
diff --git a/gettext-tools/src/xgettext.c b/gettext-tools/src/xgettext.c index eb3a660..a8f3af6 100644 --- a/gettext-tools/src/xgettext.c +++ b/gettext-tools/src/xgettext.c @@ -2791,7 +2791,7 @@ arglist_parser_remember_literal (struct arglist_parser *ap, /* Mark msgid as done. */ cp->argnum1 = 0; } - if (argnum == cp->argnum2) + else if (argnum == cp->argnum2) { cp->msgid_plural = string; cp->msgid_plural_escape = type;
Regards, -- Daiki Ueno