Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c044334

Browse files
committed
Match empty strings for regex category \B
Signed-off-by: y5c4l3 <[email protected]>
1 parent 4d68fe3 commit c044334

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Modules/_sre/sre_lib.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ SRE(at)(SRE_STATE* state, const SRE_CHAR* ptr, SRE_CODE at)
5252

5353
case SRE_AT_NON_BOUNDARY:
5454
if (state->beginning == state->end)
55-
return 0;
55+
return 1;
5656
thatp = ((void*) ptr > state->beginning) ?
5757
SRE_IS_WORD((int) ptr[-1]) : 0;
5858
thisp = ((void*) ptr < state->end) ?
@@ -70,7 +70,7 @@ SRE(at)(SRE_STATE* state, const SRE_CHAR* ptr, SRE_CODE at)
7070

7171
case SRE_AT_LOC_NON_BOUNDARY:
7272
if (state->beginning == state->end)
73-
return 0;
73+
return 1;
7474
thatp = ((void*) ptr > state->beginning) ?
7575
SRE_LOC_IS_WORD((int) ptr[-1]) : 0;
7676
thisp = ((void*) ptr < state->end) ?
@@ -88,7 +88,7 @@ SRE(at)(SRE_STATE* state, const SRE_CHAR* ptr, SRE_CODE at)
8888

8989
case SRE_AT_UNI_NON_BOUNDARY:
9090
if (state->beginning == state->end)
91-
return 0;
91+
return 1;
9292
thatp = ((void*) ptr > state->beginning) ?
9393
SRE_UNI_IS_WORD((int) ptr[-1]) : 0;
9494
thisp = ((void*) ptr < state->end) ?

0 commit comments

Comments
 (0)