fixes #9456 by only calling c_fclose if non nil
This commit is contained in:
parent
863d3ef4ed
commit
e190f485ae
1 changed files with 4 additions and 1 deletions
|
|
@ -130,7 +130,10 @@ else:
|
||||||
const
|
const
|
||||||
BufSize = 4000
|
BufSize = 4000
|
||||||
|
|
||||||
proc close*(f: File) = discard c_fclose(f)
|
proc close*(f: File) =
|
||||||
|
if not f.isNil:
|
||||||
|
discard c_fclose(f)
|
||||||
|
|
||||||
proc readChar(f: File): char =
|
proc readChar(f: File): char =
|
||||||
let x = c_fgetc(f)
|
let x = c_fgetc(f)
|
||||||
if x < 0:
|
if x < 0:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue