summaryrefslogtreecommitdiff
path: root/src/regex-emacs.c
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2023-04-12 15:50:49 -0400
committerStefan Monnier <monnier@iro.umontreal.ca>2023-04-12 15:50:49 -0400
commitc2c3114961802b4c52b4cde0271e460fb08698cf (patch)
tree874a4fa813938f3cf185682cf8aec759c8ab5843 /src/regex-emacs.c
parentd53ff9fe28b63dcd9bab2479cb7a517ba7233016 (diff)
downloademacs-c2c3114961802b4c52b4cde0271e460fb08698cf.tar.gz
(SETUP_SYNTAX_TABLE_FOR_OBJECT): Take a byteoffset
* src/syntax.c (SETUP_SYNTAX_TABLE_FOR_OBJECT): Take a byteoffset. * src/regex-emacs.c (re_search_2, re_match_2): Simplify accordingly.
Diffstat (limited to 'src/regex-emacs.c')
-rw-r--r--src/regex-emacs.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/src/regex-emacs.c b/src/regex-emacs.c
index 969f2ff9464..83caeca2464 100644
--- a/src/regex-emacs.c
+++ b/src/regex-emacs.c
@@ -3251,12 +3251,7 @@ re_search_2 (struct re_pattern_buffer *bufp, const char *str1, ptrdiff_t size1,
/* See whether the pattern is anchored. */
anchored_start = (bufp->buffer[0] == begline);
- gl_state.object = re_match_object; /* Used by SYNTAX_TABLE_BYTE_TO_CHAR. */
- {
- ptrdiff_t charpos = SYNTAX_TABLE_BYTE_TO_CHAR (startpos);
-
- SETUP_SYNTAX_TABLE_FOR_OBJECT (re_match_object, charpos, 1);
- }
+ SETUP_SYNTAX_TABLE_FOR_OBJECT (re_match_object, startpos, 1);
/* Loop through the string, looking for a place to start matching. */
for (;;)
@@ -3864,10 +3859,7 @@ re_match_2 (struct re_pattern_buffer *bufp,
{
ptrdiff_t result;
- ptrdiff_t charpos;
- gl_state.object = re_match_object; /* Used by SYNTAX_TABLE_BYTE_TO_CHAR. */
- charpos = SYNTAX_TABLE_BYTE_TO_CHAR (pos);
- SETUP_SYNTAX_TABLE_FOR_OBJECT (re_match_object, charpos, 1);
+ SETUP_SYNTAX_TABLE_FOR_OBJECT (re_match_object, pos, 1);
result = re_match_2_internal (bufp, (re_char *) string1, size1,
(re_char *) string2, size2,