Skip to content

Commit

Permalink
Merge pull request #356 from Jafaral/fix-unidoc
Browse files Browse the repository at this point in the history
unidoc: close the file when done with it
  • Loading branch information
Don-Ward authored Jan 24, 2024
2 parents e6b6522 + af178b9 commit 1496f1c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
1 change: 0 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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"

##################################################################
#
Expand Down
12 changes: 3 additions & 9 deletions uni/unidoc/UniFile.icn
Original file line number Diff line number Diff line change
Expand Up @@ -304,12 +304,6 @@ class UniFile : Object (iKeySet, uKeySet, oldTokens, buffer, line, fName,
return buffer := s
end

# <p>
# Close this file.
# </p>
method close()
write("This method is no longer used")
end

# <p>
# Is a word a keyword?
Expand Down Expand Up @@ -341,18 +335,18 @@ 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

# <b>Fails if cannot open <tt>fName</tt> for reading.</b>
initially (fileName, path)
/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...
Expand Down

0 comments on commit 1496f1c

Please sign in to comment.