about summary refs log tree commit diff
path: root/posix/regcomp.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/regcomp.c
parent550aafb9c1f58af04d2ad186f47d89ada790fa7f (diff)
downloadglibc-24992143d8109a1472f5daa1c9d6a742638a5366.tar.gz
glibc-24992143d8109a1472f5daa1c9d6a742638a5366.tar.xz
glibc-24992143d8109a1472f5daa1c9d6a742638a5366.zip
[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/regcomp.c')
-rw-r--r--posix/regcomp.c22
1 files changed, 16 insertions, 6 deletions
diff --git a/posix/regcomp.c b/posix/regcomp.c
index a8c1f748ad..2ac9953d1f 100644
--- a/posix/regcomp.c
+++ b/posix/regcomp.c
@@ -1859,7 +1859,7 @@ peek_token (token, input, syntax)
 	  if (!(syntax & RE_NO_GNU_OPS))
 	    {
 	      token->type = ANCHOR;
-	      token->opr.ctx_type = INSIDE_WORD;
+	      token->opr.ctx_type = NOT_WORD_DELIM;
 	    }
 	  break;
 	case 'w':
@@ -2349,15 +2349,25 @@ parse_expression (regexp, preg, token, syntax, nest, err)
       break;
     case ANCHOR:
       if ((token->opr.ctx_type
-	   & (WORD_DELIM | INSIDE_WORD | WORD_FIRST | WORD_LAST))
+	   & (WORD_DELIM | NOT_WORD_DELIM | WORD_FIRST | WORD_LAST))
 	  && dfa->word_ops_used == 0)
 	init_word_char (dfa);
-      if (token->opr.ctx_type == WORD_DELIM)
+      if (token->opr.ctx_type == WORD_DELIM
+          || token->opr.ctx_type == NOT_WORD_DELIM)
 	{
 	  bin_tree_t *tree_first, *tree_last;
-	  token->opr.ctx_type = WORD_FIRST;
-	  tree_first = re_dfa_add_tree_node (dfa, NULL, NULL, token);
-	  token->opr.ctx_type = WORD_LAST;
+	  if (token->opr.ctx_type == WORD_DELIM)
+	    {
+	      token->opr.ctx_type = WORD_FIRST;
+	      tree_first = re_dfa_add_tree_node (dfa, NULL, NULL, token);
+	      token->opr.ctx_type = WORD_LAST;
+            }
+          else
+            {
+	      token->opr.ctx_type = INSIDE_WORD;
+	      tree_first = re_dfa_add_tree_node (dfa, NULL, NULL, token);
+	      token->opr.ctx_type = INSIDE_NOTWORD;
+            }
 	  tree_last = re_dfa_add_tree_node (dfa, NULL, NULL, token);
 	  token->type = OP_ALT;
 	  tree = re_dfa_add_tree_node (dfa, tree_first, tree_last, token);