comparison Python/pythonrun.c @ 65615:53639e57ba40 3.1

Merged revisions 85814 via svnmerge from svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r85814 | benjamin.peterson | 2010-10-23 21:52:05 -0500 (Sat, 23 Oct 2010) | 1 line remove broken code accounting an offset the size of the line #10186 ........
author Benjamin Peterson <benjamin@python.org>
date Sun, 24 Oct 2010 02:57:31 +0000
parents 902f577e7f94
children e8c8400caa99
comparison
equal deleted inserted replaced
65613:db5abd81dc94 65615:53639e57ba40
1297 static void 1297 static void
1298 print_error_text(PyObject *f, int offset, const char *text) 1298 print_error_text(PyObject *f, int offset, const char *text)
1299 { 1299 {
1300 char *nl; 1300 char *nl;
1301 if (offset >= 0) { 1301 if (offset >= 0) {
1302 if (offset > 0 && offset == (int)strlen(text))
1303 offset--;
1304 for (;;) { 1302 for (;;) {
1305 nl = strchr(text, '\n'); 1303 nl = strchr(text, '\n');
1306 if (nl == NULL || nl-text >= offset) 1304 if (nl == NULL || nl-text >= offset)
1307 break; 1305 break;
1308 offset -= (int)(nl+1-text); 1306 offset -= (int)(nl+1-text);