From 1192de9351d824f54c3c26199a009297f02419b2 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 28 Dec 2016 08:16:33 +0530 Subject: [PATCH] Fix incorrect handling of some regular expressions in the Search tool. Fixes #1652621 [Pattern matching problem in ebook-editor](https://bugs.launchpad.net/calibre/+bug/1652621) --- src/regex/__init__.py | 2 +- src/regex/_regex.c | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/regex/__init__.py b/src/regex/__init__.py index 454bbebcb4..40a5f373a4 100644 --- a/src/regex/__init__.py +++ b/src/regex/__init__.py @@ -239,7 +239,7 @@ __all__ = ["compile", "escape", "findall", "finditer", "fullmatch", "match", "U", "UNICODE", "V0", "VERSION0", "V1", "VERSION1", "X", "VERBOSE", "W", "WORD", "error", "Regex"] -__version__ = "2.4.112" +__version__ = "2.4.113" # -------------------------------------------------------------------- # Public interface. diff --git a/src/regex/_regex.c b/src/regex/_regex.c index 17c08e2f85..bd77820d3f 100644 --- a/src/regex/_regex.c +++ b/src/regex/_regex.c @@ -10932,6 +10932,7 @@ Py_LOCAL_INLINE(Py_ssize_t) locate_required_string(RE_SafeState* safe_state, state->text_pos, limit, &is_partial); else { found_pos = state->req_pos; + end_pos = state->req_end; is_partial = FALSE; } @@ -10976,6 +10977,7 @@ Py_LOCAL_INLINE(Py_ssize_t) locate_required_string(RE_SafeState* safe_state, state->text_pos, limit, &end_pos, &is_partial); else { found_pos = state->req_pos; + end_pos = state->req_end; is_partial = FALSE; } @@ -11019,6 +11021,7 @@ Py_LOCAL_INLINE(Py_ssize_t) locate_required_string(RE_SafeState* safe_state, state->text_pos, limit, &end_pos, &is_partial); else { found_pos = state->req_pos; + end_pos = state->req_end; is_partial = FALSE; } @@ -11062,6 +11065,7 @@ Py_LOCAL_INLINE(Py_ssize_t) locate_required_string(RE_SafeState* safe_state, state->text_pos, limit, &is_partial); else { found_pos = state->req_pos; + end_pos = state->req_end; is_partial = FALSE; } @@ -11106,6 +11110,7 @@ Py_LOCAL_INLINE(Py_ssize_t) locate_required_string(RE_SafeState* safe_state, state->text_pos, limit, &is_partial); else { found_pos = state->req_pos; + end_pos = state->req_end; is_partial = FALSE; } @@ -11150,6 +11155,7 @@ Py_LOCAL_INLINE(Py_ssize_t) locate_required_string(RE_SafeState* safe_state, state->text_pos, limit, &is_partial); else { found_pos = state->req_pos; + end_pos = state->req_end; is_partial = FALSE; }