]> git.ipfire.org Git - thirdparty/gettext.git/commit
xgettext: C: Improve heuristic for format strings.
authorBruno Haible <bruno@clisp.org>
Sun, 1 Jun 2025 22:11:27 +0000 (00:11 +0200)
committerBruno Haible <bruno@clisp.org>
Mon, 2 Jun 2025 00:21:06 +0000 (02:21 +0200)
commitcdc6870c776922b66cabf11f5bdd5a978a577384
treed15a1830580da0c5e7be9c89bd8a6ece49392aae
parentb330ce78045430003b353b0d4f71327c251c6b75
xgettext: C: Improve heuristic for format strings.

* gettext-tools/src/format-c-parse.h (struct spec): Add field
'likely_intentional_directives'.
(format_parse_entrails): Set it to the number of directives that don't contain
a space.
* gettext-tools/src/format-c.c (format_is_unlikely_intentional): Also test the
'likely_intentional_directives' field.
* gettext-tools/tests/format-c-6: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add it.
gettext-tools/src/format-c-parse.h
gettext-tools/src/format-c.c
gettext-tools/tests/Makefile.am
gettext-tools/tests/format-c-6 [new file with mode: 0755]