aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorStefan Monnier2006-10-03 13:19:18 +0000
committerStefan Monnier2006-10-03 13:19:18 +0000
commit6224b623fd39be87b33e0ff7dd582a3e8818e340 (patch)
treea5e02a35bd67b865fdf045ee778fbfe1602dbcc2 /src
parent1351dd3b9a76d557c6795b84f77fd738839bffbc (diff)
downloademacs-6224b623fd39be87b33e0ff7dd582a3e8818e340.tar.gz
emacs-6224b623fd39be87b33e0ff7dd582a3e8818e340.zip
(regex_compile): Set the new `used_syntax' bit.
Diffstat (limited to 'src')
-rw-r--r--src/regex.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/regex.c b/src/regex.c
index 66e363e731c..ae80ad0cee8 100644
--- a/src/regex.c
+++ b/src/regex.c
@@ -2530,6 +2530,7 @@ regex_compile (pattern, size, syntax, bufp)
2530 bufp->syntax = syntax; 2530 bufp->syntax = syntax;
2531 bufp->fastmap_accurate = 0; 2531 bufp->fastmap_accurate = 0;
2532 bufp->not_bol = bufp->not_eol = 0; 2532 bufp->not_bol = bufp->not_eol = 0;
2533 bufp->used_syntax = 0;
2533 2534
2534 /* Set `used' to zero, so that if we return an error, the pattern 2535 /* Set `used' to zero, so that if we return an error, the pattern
2535 printer (for debugging) will think there's no pattern. We reset it 2536 printer (for debugging) will think there's no pattern. We reset it
@@ -2942,6 +2943,14 @@ regex_compile (pattern, size, syntax, bufp)
2942 SET_LIST_BIT (translated); 2943 SET_LIST_BIT (translated);
2943 } 2944 }
2944 2945
2946 /* In most cases the matching rule for char classes
2947 only uses the syntax table for multibyte chars,
2948 so that the content of the syntax-table it is not
2949 hardcoded in the range_table. SPACE and WORD are
2950 the two exceptions. */
2951 if ((1 << cc) & ((1 << RECC_SPACE) | (1 << RECC_WORD)))
2952 bufp->used_syntax = 1;
2953
2945 /* Repeat the loop. */ 2954 /* Repeat the loop. */
2946 continue; 2955 continue;
2947 } 2956 }