xgettext: Shell: Bump phase1_pushback buffer size.

* gettext-tools/src/x-sh.c (phase1_pushback): Bump size to 9.
* gettext-tools/tests/xgettext-sh-8: Add more test cases.
This commit is contained in:
Bruno Haible 2025-06-21 06:46:55 +02:00
parent 81c37f4901
commit 06858e5651
2 changed files with 18 additions and 2 deletions

View File

@ -185,7 +185,7 @@ do_ungetc (int c)
/* Remove backslash followed by newline from the input stream. */
static int phase1_pushback[2];
static int phase1_pushback[9];
static int phase1_pushback_length;
static int
@ -215,7 +215,7 @@ phase1_getc ()
}
}
/* Supports only one pushback character. */
/* Supports 9 pushback characters. */
static void
phase1_ungetc (int c)
{

View File

@ -5,6 +5,10 @@
cat <<\EOF > xg-sh-8.sh
echo `gettext $'\'\x'`
gettext $'\u#'
gettext $'\U#'
gettext $'\U123456'
gettext $'\U12345678'
EOF
: ${XGETTEXT=xgettext}
@ -14,6 +18,18 @@ LC_ALL=C tr -d '\r' < xg-sh-8.tmp.po > xg-sh-8.po || Exit 1
cat <<\EOF > xg-sh-8.ok
msgid "'\\x"
msgstr ""
msgid "\\u#"
msgstr ""
msgid "\\U#"
msgstr ""
msgid "\\U123456"
msgstr ""
msgid "\\U12345678"
msgstr ""
EOF
: ${DIFF=diff}