1
0
forked from aniani/vim

updated for version 7.3.943

Problem:    Python: Negative indices were failing.
Solution:   Fix negative indices. Add tests. (ZyX)
This commit is contained in:
Bram Moolenaar
2013-05-12 21:16:23 +02:00
parent 8f1723de47
commit bd80f35bc5
7 changed files with 120 additions and 4 deletions

View File

@@ -1114,7 +1114,7 @@ BufferSubscript(PyObject *self, PyObject* idx)
return NULL;
if (PySlice_GetIndicesEx((PyObject *)idx,
(Py_ssize_t)((BufferObject *)(self))->buf->b_ml.ml_line_count+1,
(Py_ssize_t)((BufferObject *)(self))->buf->b_ml.ml_line_count,
&start, &stop,
&step, &slicelen) < 0)
{
@@ -1146,7 +1146,7 @@ BufferAsSubscript(PyObject *self, PyObject* idx, PyObject* val)
return -1;
if (PySlice_GetIndicesEx((PyObject *)idx,
(Py_ssize_t)((BufferObject *)(self))->buf->b_ml.ml_line_count+1,
(Py_ssize_t)((BufferObject *)(self))->buf->b_ml.ml_line_count,
&start, &stop,
&step, &slicelen) < 0)
{