Skip to content

Commit

Permalink
added CloseStream() in ReadMTXE()
Browse files Browse the repository at this point in the history
  • Loading branch information
LeonidPryadko committed Nov 20, 2024
1 parent 5ff87cc commit 05d7da4
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/qdistrnd.g
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ BindGlobal("QDR_ProcEntry",
#DeclareGlobalFunction("ReadMTXE");
BindGlobal("ReadMTXE",
function(StrPath, opt... ) # supported option: "field"
local input, data, fmt, line, pair, F, rowsG, colsG, G, G1, i,
local input, data, fmt, line, pair, F, rowsG, colsG, G, G1, i, infile,
iCommentStart,iComment;
# local variables:
# input - file converted to a string
Expand All @@ -483,7 +483,9 @@ BindGlobal("ReadMTXE",
# i - dummy for "for" loop
# iCommentStart, iComment - range of line numbers for comment section

input := ReadAll(InputTextFile(StrPath));; # read the file in
infile := InputTextFile(StrPath);
input := ReadAll();; # read the file in
CloseStream(infile);
data := SplitString(input, "\n");; # separate into lines
line := SplitString(data[1], " ");; # separate into records

Expand Down

0 comments on commit 05d7da4

Please sign in to comment.