diff Python/pythonrun.c @ 65695:64cee8d11f2e 2.7

Merged revisions 85904 via svnmerge from svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r85904 | benjamin.peterson | 2010-10-28 22:28:14 -0500 (Thu, 28 Oct 2010) | 1 line decrement offset when it points to a newline (#10186 followup) ........
author Benjamin Peterson <benjamin@python.org>
date Fri, 29 Oct 2010 03:45:34 +0000
parents a4a27240fe09
children b36cb4602e21
line wrap: on
line diff
--- a/Python/pythonrun.c	Thu Oct 28 14:50:57 2010 +0000
+++ b/Python/pythonrun.c	Fri Oct 29 03:45:34 2010 +0000
@@ -1045,6 +1045,8 @@
 {
     char *nl;
     if (offset >= 0) {
+        if (offset > 0 && offset == strlen(text) && text[offset - 1] == '\n')
+            offset--;
         for (;;) {
             nl = strchr(text, '\n');
             if (nl == NULL || nl-text >= offset)