Skip to content

Commit

Permalink
fix nim-lang#16011 endOfFile
Browse files Browse the repository at this point in the history
  • Loading branch information
timotheecour committed Nov 17, 2020
1 parent 61352d5 commit 0057e11
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions lib/system/io.nim
Original file line number Diff line number Diff line change
Expand Up @@ -531,10 +531,7 @@ proc rawFileSize(file: File): int64 =

proc endOfFile*(f: File): bool {.tags: [], benign.} =
## Returns true if `f` is at the end.
var c = c_fgetc(f)
discard c_ungetc(c, f)
return c < 0'i32
#result = c_feof(f) != 0
result = c_feof(f) != 0 # fixes bug #16011

proc readAllFile(file: File, len: int64): string =
# We acquire the filesize beforehand and hope it doesn't change.
Expand Down

0 comments on commit 0057e11

Please sign in to comment.