diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2025-01-02 12:11:21 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-01-02 12:11:21 (GMT) |
commit | a3711d1541c1b7987941b41d2247f87dae347117 (patch) | |
tree | d335b8acd65d95bfc8808f49823619d3c1b9d970 /Modules | |
parent | 8d16919a06a55a50756bf083221a6f6cab43de50 (diff) | |
download | cpython-a3711d1541c1b7987941b41d2247f87dae347117.zip cpython-a3711d1541c1b7987941b41d2247f87dae347117.tar.gz cpython-a3711d1541c1b7987941b41d2247f87dae347117.tar.bz2 |
gh-124130: Fix a bug in matching regular expression \B in empty string (GH-127007)
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/_sre/sre_lib.h | 12 |
1 files changed, 0 insertions, 12 deletions
diff --git a/Modules/_sre/sre_lib.h b/Modules/_sre/sre_lib.h index af4bfc5..df37790 100644 --- a/Modules/_sre/sre_lib.h +++ b/Modules/_sre/sre_lib.h @@ -42,8 +42,6 @@ SRE(at)(SRE_STATE* state, const SRE_CHAR* ptr, SRE_CODE at) return ((void*) ptr == state->end); case SRE_AT_BOUNDARY: - if (state->beginning == state->end) - return 0; thatp = ((void*) ptr > state->beginning) ? SRE_IS_WORD((int) ptr[-1]) : 0; thisp = ((void*) ptr < state->end) ? @@ -51,8 +49,6 @@ SRE(at)(SRE_STATE* state, const SRE_CHAR* ptr, SRE_CODE at) return thisp != thatp; case SRE_AT_NON_BOUNDARY: - if (state->beginning == state->end) - return 0; thatp = ((void*) ptr > state->beginning) ? SRE_IS_WORD((int) ptr[-1]) : 0; thisp = ((void*) ptr < state->end) ? @@ -60,8 +56,6 @@ SRE(at)(SRE_STATE* state, const SRE_CHAR* ptr, SRE_CODE at) return thisp == thatp; case SRE_AT_LOC_BOUNDARY: - if (state->beginning == state->end) - return 0; thatp = ((void*) ptr > state->beginning) ? SRE_LOC_IS_WORD((int) ptr[-1]) : 0; thisp = ((void*) ptr < state->end) ? @@ -69,8 +63,6 @@ SRE(at)(SRE_STATE* state, const SRE_CHAR* ptr, SRE_CODE at) return thisp != thatp; case SRE_AT_LOC_NON_BOUNDARY: - if (state->beginning == state->end) - return 0; thatp = ((void*) ptr > state->beginning) ? SRE_LOC_IS_WORD((int) ptr[-1]) : 0; thisp = ((void*) ptr < state->end) ? @@ -78,8 +70,6 @@ SRE(at)(SRE_STATE* state, const SRE_CHAR* ptr, SRE_CODE at) return thisp == thatp; case SRE_AT_UNI_BOUNDARY: - if (state->beginning == state->end) - return 0; thatp = ((void*) ptr > state->beginning) ? SRE_UNI_IS_WORD((int) ptr[-1]) : 0; thisp = ((void*) ptr < state->end) ? @@ -87,8 +77,6 @@ SRE(at)(SRE_STATE* state, const SRE_CHAR* ptr, SRE_CODE at) return thisp != thatp; case SRE_AT_UNI_NON_BOUNDARY: - if (state->beginning == state->end) - return 0; thatp = ((void*) ptr > state->beginning) ? SRE_UNI_IS_WORD((int) ptr[-1]) : 0; thisp = ((void*) ptr < state->end) ? |