Patch # 188 by Philip Jenvey.

Make tell() mark CRLF as a newline.
With unit test.
This commit is contained in:
Guido van Rossum 2007-09-22 20:18:03 +00:00
parent aaad0d602b
commit ad8fb0d47c
2 changed files with 8 additions and 0 deletions

View file

@ -718,6 +718,7 @@ file_tell(PyFileObject *f)
int c;
c = GETC(f->f_fp);
if (c == '\n') {
f->f_newlinetypes |= NEWLINE_CRLF;
pos++;
f->f_skipnextlf = 0;
} else if (c != EOF) ungetc(c, f->f_fp);