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

Skip to content

Commit ef34bd2

Browse files
author
Fredrik Lundh
committed
-- changed $ to match before a trailing newline, even
if the multiline flag isn't given.
1 parent 4767402 commit ef34bd2

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

Modules/_sre.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,9 @@ SRE_AT(SRE_STATE* state, SRE_CHAR* ptr, SRE_CODE at)
310310
SRE_IS_LINEBREAK((int) ptr[-1]));
311311

312312
case SRE_AT_END:
313-
return ((void*) ptr == state->end);
313+
return (((void*) (ptr+1) == state->end &&
314+
SRE_IS_LINEBREAK((int) ptr[0])) ||
315+
((void*) ptr == state->end));
314316

315317
case SRE_AT_END_LINE:
316318
return ((void*) ptr == state->end ||

0 commit comments

Comments
 (0)