mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
Ugly band-aid to work around a bug in Linux ftell().
This commit is contained in:
parent
a58153e8bf
commit
91aaa92c88
1 changed files with 3 additions and 1 deletions
|
@ -421,7 +421,9 @@ new_buffersize(f, currentsize)
|
|||
struct stat st;
|
||||
if (fstat(fileno(f->f_fp), &st) == 0) {
|
||||
end = st.st_size;
|
||||
pos = ftell(f->f_fp);
|
||||
pos = lseek(fileno(f->f_fp), 0L, SEEK_CUR);
|
||||
if (pos >= 0)
|
||||
pos = ftell(f->f_fp);
|
||||
if (pos < 0)
|
||||
clearerr(f->f_fp);
|
||||
if (end > pos && pos >= 0)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue