[Python-checkins] r85905 - in python/branches/release27-maint: Python/pythonrun.c

benjamin.peterson python-checkins at python.org
Fri Oct 29 05:45:34 CEST 2010


Author: benjamin.peterson
Date: Fri Oct 29 05:45:34 2010
New Revision: 85905

Log:
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)
........


Modified:
   python/branches/release27-maint/   (props changed)
   python/branches/release27-maint/Python/pythonrun.c

Modified: python/branches/release27-maint/Python/pythonrun.c
==============================================================================
--- python/branches/release27-maint/Python/pythonrun.c	(original)
+++ python/branches/release27-maint/Python/pythonrun.c	Fri Oct 29 05:45:34 2010
@@ -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)


More information about the Python-checkins mailing list