diff options
author | Stefan Monnier <monnier@iro.umontreal.ca> | 2013-05-21 17:48:52 -0400 |
---|---|---|
committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2013-05-21 17:48:52 -0400 |
commit | fc30d803f4325ebf67eee72a5a98100f01f6b182 (patch) | |
tree | 9c0d1e02511a25874c6979babb918a90fe30d063 /src/search.c | |
parent | c2d41179e1121ad6f6e61962a06c31229f7b8af7 (diff) | |
download | emacs-fc30d803f4325ebf67eee72a5a98100f01f6b182.tar.gz |
* src/search.c (looking_at_1): Only set last_thing_searched if the match
changed the match-data.
Fixes: debbugs:14281
Diffstat (limited to 'src/search.c')
-rw-r--r-- | src/search.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/search.c b/src/search.c index ea36133deb7..8b4d39c7811 100644 --- a/src/search.c +++ b/src/search.c @@ -328,18 +328,18 @@ looking_at_1 (Lisp_Object string, bool posix) val = (i >= 0 ? Qt : Qnil); if (NILP (Vinhibit_changing_match_data) && i >= 0) + { for (i = 0; i < search_regs.num_regs; i++) if (search_regs.start[i] >= 0) { search_regs.start[i] = BYTE_TO_CHAR (search_regs.start[i] + BEGV_BYTE); - search_regs.end[i] - = BYTE_TO_CHAR (search_regs.end[i] + BEGV_BYTE); - } - - /* Set last_thing_searched only when match data is changed. */ - if (NILP (Vinhibit_changing_match_data)) + search_regs.end[i] + = BYTE_TO_CHAR (search_regs.end[i] + BEGV_BYTE); + } + /* Set last_thing_searched only when match data is changed. */ XSETBUFFER (last_thing_searched, current_buffer); + } return val; } |