~pythonregexp2.7/python/issue2636-01+09-01-01

« back to all changes in this revision

Viewing changes to Objects/sliceobject.c

  • Committer: Jeffrey C. "The TimeHorse" Jacobs
  • Date: 2008-09-22 00:02:12 UTC
  • mfrom: (39022.1.34 Regexp-2.7)
  • Revision ID: darklord@timehorse.com-20080922000212-7r0q4f4ugiq57jph
Merged in changes from the Atomic Grouping / Possessive Qualifiers branch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
169
169
        else {
170
170
                if (!_PyEval_SliceIndex(r->stop, stop)) return -1;
171
171
                if (*stop < 0) *stop += length;
172
 
                if (*stop < 0) *stop = -1;
173
 
                if (*stop > length) *stop = length;
 
172
                if (*stop < 0) *stop = (*step < 0) ? -1 : 0;
 
173
                if (*stop >= length)
 
174
                        *stop = (*step < 0) ? length - 1 : length;
174
175
        }
175
176
 
176
177
        if ((*step < 0 && *stop >= *start)