Kaydet (Commit) d30dc0a5 authored tarafından Guido van Rossum's avatar Guido van Rossum

Clear the error condition set by ftell().

üst 0eae8fba
......@@ -416,6 +416,8 @@ new_buffersize(f, currentsize)
if (fstat(fileno(f->f_fp), &st) == 0) {
end = st.st_size;
pos = ftell(f->f_fp);
if (pos < 0)
clearerr(f->f_fp);
if (end > pos && pos >= 0)
return end - pos + 1;
/* Add 1 so if the file were to grow we'd notice. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment