aboutsummaryrefslogtreecommitdiff
path: root/posix/tst-rxspencer.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2005-01-26 19:56:03 +0000
committerUlrich Drepper <drepper@redhat.com>2005-01-26 19:56:03 +0000
commit24992143d8109a1472f5daa1c9d6a742638a5366 (patch)
tree999fe43f9ab6494dd1ca70e0a4e4270051d9257a /posix/tst-rxspencer.c
parent550aafb9c1f58af04d2ad186f47d89ada790fa7f (diff)
downloadglibc-24992143d8109a1472f5daa1c9d6a742638a5366.zip
glibc-24992143d8109a1472f5daa1c9d6a742638a5366.tar.gz
glibc-24992143d8109a1472f5daa1c9d6a742638a5366.tar.bz2
[BZ #693]
Update. 2005-01-26 Jakub Jelinek <jakub@redhat.com> * sysdeps/unix/sysv/linux/i386/sysdep.h (SYSCALL_ERROR_HANDLER_TLS_STORE): Remove unnecessary 0 imm. [BZ #693] * posix/regex_internal.h (DUMMY_CONSTRAINT): Rename to... (WORD_DELIM_CONSTRAINT): ...this. (NOT_WORD_DELIM_CONSTRAINT): Define. (re_context_type): Add INSIDE_NOTWORD and NOT_WORD_DELIM, change WORD_DELIM to use WORD_DELIM_CONSTRAINT. * posix/regcomp.c (peek_token): For \B create NOT_WORD_DELIM anchor instead of INSIDE_WORD. (parse_expression): Handle NOT_WORD_DELIM constraint. * posix/bug-regex19.c (tests): Adjust tests that relied on \B being inside word instead of not word delim. * posix/tst-rxspencer.c (mb_frob_pattern): Don't frob escaped characters. * posix/rxspencer/tests: Add some new tests.
Diffstat (limited to 'posix/tst-rxspencer.c')
-rw-r--r--posix/tst-rxspencer.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/posix/tst-rxspencer.c b/posix/tst-rxspencer.c
index cb40421..a68bab2 100644
--- a/posix/tst-rxspencer.c
+++ b/posix/tst-rxspencer.c
@@ -1,5 +1,5 @@
/* Regular expression tests.
- Copyright (C) 2003 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2005 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jakub@redhat.com>, 2003.
@@ -127,14 +127,15 @@ mb_frob_string (const char *str, const char *letters)
}
/* Like mb_frob_string, but don't replace anything between
- [: and :], [. and .] or [= and =]. */
+ [: and :], [. and .] or [= and =] or characters escaped
+ with a backslash. */
static char *
mb_frob_pattern (const char *str, const char *letters)
{
char *ret, *dst;
const char *src;
- int in_class = 0;
+ int in_class = 0, escaped = 0;
if (str == NULL)
return NULL;
@@ -144,7 +145,18 @@ mb_frob_pattern (const char *str, const char *letters)
return NULL;
for (src = str, dst = ret; *src; ++src)
- if (!in_class && strchr (letters, *src))
+ if (*src == '\\')
+ {
+ escaped ^= 1;
+ *dst++ = *src;
+ }
+ else if (escaped)
+ {
+ escaped = 0;
+ *dst++ = *src;
+ continue;
+ }
+ else if (!in_class && strchr (letters, *src))
dst = mb_replace (dst, *src);
else
{