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)
........
diff --git a/Python/pythonrun.c b/Python/pythonrun.c
index f3b4e50..87ffb39 100644
--- a/Python/pythonrun.c
+++ b/Python/pythonrun.c
@@ -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)