mirror of
https://sourceware.org/git/glibc.git
synced 2025-09-01 05:02:03 +03:00
2002-12-14 Jakub Jelinek <jakub@redhat.com>
* posix/regex_internal.c (re_string_context_at): Guard wide char code with #ifdef RE_ENABLE_I18N.
This commit is contained in:
@@ -562,14 +562,8 @@ re_string_context_at (input, idx, eflags, newline_anchor)
|
|||||||
return ((eflags & REG_NOTEOL) ? CONTEXT_ENDBUF
|
return ((eflags & REG_NOTEOL) ? CONTEXT_ENDBUF
|
||||||
: CONTEXT_NEWLINE | CONTEXT_ENDBUF);
|
: CONTEXT_NEWLINE | CONTEXT_ENDBUF);
|
||||||
}
|
}
|
||||||
if (MB_CUR_MAX == 1)
|
#ifdef RE_ENABLE_I18N
|
||||||
{
|
if (MB_CUR_MAX > 1)
|
||||||
c = re_string_byte_at (input, idx);
|
|
||||||
if (IS_WORD_CHAR (c))
|
|
||||||
return CONTEXT_WORD;
|
|
||||||
return (newline_anchor && IS_NEWLINE (c)) ? CONTEXT_NEWLINE : 0;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
wint_t wc;
|
wint_t wc;
|
||||||
int wc_idx = idx;
|
int wc_idx = idx;
|
||||||
@@ -588,6 +582,14 @@ re_string_context_at (input, idx, eflags, newline_anchor)
|
|||||||
return CONTEXT_WORD;
|
return CONTEXT_WORD;
|
||||||
return (newline_anchor && IS_WIDE_NEWLINE (wc)) ? CONTEXT_NEWLINE : 0;
|
return (newline_anchor && IS_WIDE_NEWLINE (wc)) ? CONTEXT_NEWLINE : 0;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
#endif
|
||||||
|
{
|
||||||
|
c = re_string_byte_at (input, idx);
|
||||||
|
if (IS_WORD_CHAR (c))
|
||||||
|
return CONTEXT_WORD;
|
||||||
|
return (newline_anchor && IS_NEWLINE (c)) ? CONTEXT_NEWLINE : 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Functions for set operation. */
|
/* Functions for set operation. */
|
||||||
|
Reference in New Issue
Block a user