diff src/if_python3.c @ 4389:736b8e18a3bc v7.3.943

updated for version 7.3.943 Problem: Python: Negative indices were failing. Solution: Fix negative indices. Add tests. (ZyX)
author Bram Moolenaar <bram@vim.org>
date Sun, 12 May 2013 21:16:23 +0200
parents 358c10968c7f
children 80eea7a9d6b9
line wrap: on
line diff
--- a/src/if_python3.c
+++ b/src/if_python3.c
@@ -1114,7 +1114,7 @@ BufferSubscript(PyObject *self, PyObject
 	    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, PyObje
 	    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)
 	{