mirror of
https://github.com/python/cpython.git
synced 2025-08-01 15:43:13 +00:00
Patch # 188 by Philip Jenvey.
Make tell() mark CRLF as a newline. With unit test.
This commit is contained in:
parent
aaad0d602b
commit
ad8fb0d47c
2 changed files with 8 additions and 0 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue