diff options
| author | Stefan Monnier | 2023-04-12 15:44:58 -0400 |
|---|---|---|
| committer | Stefan Monnier | 2023-04-12 15:44:58 -0400 |
| commit | d53ff9fe28b63dcd9bab2479cb7a517ba7233016 (patch) | |
| tree | 4076a26452f8261226cc5b793d07a3a4e332fa9d /exec/exec.c | |
| parent | 1e6463ad22cd74b1b74b9395dff8c8b1485e202e (diff) | |
| download | emacs-d53ff9fe28b63dcd9bab2479cb7a517ba7233016.tar.gz emacs-d53ff9fe28b63dcd9bab2479cb7a517ba7233016.zip | |
src/regex-emacs.c (POS_AS_IN_BUFFER): Delete macro
That macro added 1 to buffer positions because:
Strings are 0-indexed, buffers are 1-indexed
but the reality is that this 1 was added to the regexp engine's "byte
offsets" which are not 1-based byte positions as used throughout
the rest of Emacs, but they are BEGV_BYTE-relative offsets, so the two
did not cancel out.
* src/regex-emacs.c (PTR_TO_OFFSET, POS_AS_IN_BUFFER): Delete macros;
use `POINTER_TO_OFFSET` instead.
(re_search_2, re_match_2, re_match_2_internal): Adjust accordingly.
* src/syntax.h (SYNTAX_TABLE_BYTE_TO_CHAR): Don't remove 1 from buffer
byteoffsets now that `POS_AS_IN_BUFFER` doesn't add it any more.
Diffstat (limited to 'exec/exec.c')
0 files changed, 0 insertions, 0 deletions