Merge pull request #9457 from Vindaar/fixes-9456

Fixes #9456
This commit is contained in:
Arne Döring 2018-10-20 21:57:17 +02:00 • committed by GitHub
commit ce05a850a5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 1 deletions

View file

@ -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:

View file

@ -103,3 +103,7 @@ block t5349:
for line in lines("test.txt"): for line in lines("test.txt"):
echo line echo line
block t9456:
var f: File
f.close()