Skip to content

Commit af178b9

Browse files
committed
unidoc: close the file when done with it
Signed-off-by: Jafar Al-Gharaibeh <[email protected]>
1 parent 5640082 commit af178b9

File tree

2 files changed

+3
-10
lines changed

2 files changed

+3
-10
lines changed

Makefile

-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ help:
6161
@echo " sh configure --build=x86_64-w64-mingw32"
6262
@echo " make"
6363
@echo
64-
@echo " The --help option of configure gives details of build options"
6564

6665
##################################################################
6766
#

uni/unidoc/UniFile.icn

+3-9
Original file line numberDiff line numberDiff line change
@@ -304,12 +304,6 @@ class UniFile : Object (iKeySet, uKeySet, oldTokens, buffer, line, fName,
304304
return buffer := s
305305
end
306306

307-
# <p>
308-
# Close this file.
309-
# </p>
310-
method close()
311-
write("This method is no longer used")
312-
end
313307

314308
# <p>
315309
# Is a word a keyword?
@@ -341,18 +335,18 @@ class UniFile : Object (iKeySet, uKeySet, oldTokens, buffer, line, fName,
341335
}
342336
end
343337

344-
method getFromFile(f)
338+
method readFile(f)
345339
cBuf := CodeBuf()
346340
while line := read(f) do cBuf.add(line)
347-
close(f)
348341
end
349342

350343
# <b>Fails if cannot open <tt>fName</tt> for reading.</b>
351344
initially (fileName, path)
352345
/path := ""
353346
fName := delSuffix(fileName,".icn")||".icn"
354347
f := open(path||fName) | fail
355-
getFromFile(f)
348+
readFile(f)
349+
close(f)
356350
clearBuffer()
357351
line := ""
358352
# the only keywords we care about, everything else is noise...

0 commit comments

Comments
 (0)