From 9ec884756ca74bf4c0fadebf4669afe3b10da839 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 31 Dec 2013 17:46:20 +0530 Subject: [PATCH] Edit book: Fix a bug in the regex engine that calibre uses that could cause various incorrect results in some special circumstances. Fixes #1263461 [Edit Book: Count all + Case sensitive is "broken"](https://bugs.launchpad.net/calibre/+bug/1263461) See https://code.google.com/p/mrab-regex-hg/issues/detail?can=2&start=0&num=100&q=&colspec=ID%20Type%20Status%20Priority%20Milestone%20Owner%20Summary&groupby=&sort=&id=101 for discussion. --- src/regex/_regex.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/regex/_regex.c b/src/regex/_regex.c index 43f2135920..4418ccd817 100644 --- a/src/regex/_regex.c +++ b/src/regex/_regex.c @@ -13232,6 +13232,7 @@ Py_LOCAL_INLINE(BOOL) state_init_2(RE_State* state, PatternObject* pattern, state->groups = NULL; state->repeats = NULL; + state->req_pos = -1; state->visible_captures = visible_captures; state->match_all = match_all; state->backtrack_block.previous = NULL;