/* Maximum supported nesting depth. */
#define MAX_NESTING_DEPTH 1000
-/* Current nesting depth. */
+/* Current nesting depths. */
+static int escape_nesting_depth;
static int nesting_depth;
static int
do_getc_escaped (int c, bool in_string)
{
+ if (escape_nesting_depth > MAX_NESTING_DEPTH)
+ {
+ error_with_progname = false;
+ error (EXIT_FAILURE, 0, _("%s:%d: error: too deeply nested escape sequence"),
+ logical_file_name, line_number);
+ }
switch (c)
{
case 'a':
c = do_getc ();
if (c == EOF)
return EOF;
+ ++escape_nesting_depth;
c = do_getc_escaped (c, false);
+ escape_nesting_depth--;
}
return c | 0x80;
c = do_getc ();
if (c == EOF)
return EOF;
+ ++escape_nesting_depth;
c = do_getc_escaped (c, false);
+ escape_nesting_depth--;
}
return (c >= 'a' && c <= 'z' ? c - 'a' + 'A' : c);
c = do_getc ();
if (c == EOF)
return EOF;
+ ++escape_nesting_depth;
c = do_getc_escaped (c, false);
+ escape_nesting_depth--;
}
return c;
c = do_getc ();
if (c == EOF)
return EOF;
+ ++escape_nesting_depth;
c = do_getc_escaped (c, false);
+ escape_nesting_depth--;
}
if (c == '?')
return 0x7F;
last_non_comment_line = -1;
flag_context_list_table = flag_table;
+ escape_nesting_depth = 0;
nesting_depth = 0;
init_keywords ();
xgettext-desktop-1 xgettext-desktop-2 \
xgettext-elisp-1 xgettext-elisp-2 \
xgettext-elisp-stackovfl-1 xgettext-elisp-stackovfl-2 \
+ xgettext-elisp-stackovfl-3 xgettext-elisp-stackovfl-4 \
xgettext-glade-1 xgettext-glade-2 xgettext-glade-3 xgettext-glade-4 \
xgettext-glade-5 xgettext-glade-6 xgettext-glade-7 \
xgettext-gsettings-1 \
gettextpo-1.de.po \
xgettext-1 \
xgettext-c-1 xg-c-comment-6.c xg-c-escape-3.c xg-vala-2.vala \
- common/supplemental/plurals.xml
+ common/supplemental/plurals.xml \
+ testdata/xg-el-so-3.el testdata/xg-el-so-4.el
XGETTEXT = ../src/xgettext