From af178b9c8fccc56a51082a5bdfed0773c2e27d16 Mon Sep 17 00:00:00 2001 From: Jafar Al-Gharaibeh Date: Wed, 24 Jan 2024 00:05:44 -0600 Subject: [PATCH] unidoc: close the file when done with it Signed-off-by: Jafar Al-Gharaibeh --- Makefile | 1 - uni/unidoc/UniFile.icn | 12 +++--------- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/Makefile b/Makefile index 28656e077..8e2b44d3c 100644 --- a/Makefile +++ b/Makefile @@ -61,7 +61,6 @@ help: @echo " sh configure --build=x86_64-w64-mingw32" @echo " make" @echo - @echo " The --help option of configure gives details of build options" ################################################################## # diff --git a/uni/unidoc/UniFile.icn b/uni/unidoc/UniFile.icn index e22f764a2..77bf35fdb 100644 --- a/uni/unidoc/UniFile.icn +++ b/uni/unidoc/UniFile.icn @@ -304,12 +304,6 @@ class UniFile : Object (iKeySet, uKeySet, oldTokens, buffer, line, fName, return buffer := s end - #

- # Close this file. - #

- method close() - write("This method is no longer used") - end #

# Is a word a keyword? @@ -341,10 +335,9 @@ class UniFile : Object (iKeySet, uKeySet, oldTokens, buffer, line, fName, } end - method getFromFile(f) + method readFile(f) cBuf := CodeBuf() while line := read(f) do cBuf.add(line) - close(f) end # Fails if cannot open fName for reading. @@ -352,7 +345,8 @@ class UniFile : Object (iKeySet, uKeySet, oldTokens, buffer, line, fName, /path := "" fName := delSuffix(fileName,".icn")||".icn" f := open(path||fName) | fail - getFromFile(f) + readFile(f) + close(f) clearBuffer() line := "" # the only keywords we care about, everything else is noise...