diff -r b2c17681404f Modules/_sre.c --- a/Modules/_sre.c Fri Nov 07 22:33:19 2014 +0200 +++ b/Modules/_sre.c Sat Nov 08 10:53:30 2014 +0200 @@ -893,14 +893,6 @@ pattern_split(PatternObject* self, PyObj goto error; } - if (state.start == state.ptr) { - if (last == state.end) - break; - /* skip one character */ - state.start = (void*) ((char*) state.ptr + state.charsize); - continue; - } - /* get segment before this match */ item = getslice(state.isbytes, state.beginning, string, STATE_OFFSET(&state, last), @@ -926,6 +918,15 @@ pattern_split(PatternObject* self, PyObj n = n + 1; + if (state.start == state.ptr) { + if (last == state.end) + break; + /* skip one character */ + last = state.ptr; + state.start = (void*) ((char*) state.ptr + state.charsize); + continue; + } + last = state.start = state.ptr; }