--- python/branches/release25-maint/Modules/_sre.c.bak Mon Feb 04 22:00:35 2008 +++ python/branches/release25-maint/Modules/_sre.c Wed Jul 02 23:24:01 2008 @@ -2216,13 +2216,8 @@ goto error; } - if (state.start == state.ptr) { - if (last == state.end) - break; - /* skip one character */ - state.start = (void*) ((char*) state.ptr + state.charsize); - continue; - } + if (state.start == state.ptr && last == state.end) + break; /* get segment before this match */ item = PySequence_GetSlice( @@ -2249,8 +2244,14 @@ n = n + 1; - last = state.start = state.ptr; - + last = state.ptr; + + if (state.start == state.ptr) { + /* skip one character */ + state.start = (void*) ((char*) state.ptr + state.charsize); + } + else + state.start = state.ptr; } /* get segment following last match (even if empty) */