summaryrefslogtreecommitdiff
path: root/tex/context/base/mkxl/util-fil.lmt
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2022-01-06 20:05:31 +0100
committerContext Git Mirror Bot <phg@phi-gamma.net>2022-01-06 20:05:31 +0100
commit40c16033d164a969e06aacc991371592731baf2a (patch)
treed74d6ccd0713b41105b83b1410d27915c7b68649 /tex/context/base/mkxl/util-fil.lmt
parent9b1c3470a7a222ef9ae20106d750c4a0127819a7 (diff)
downloadcontext-40c16033d164a969e06aacc991371592731baf2a.tar.gz
2022-01-06 19:50:00
Diffstat (limited to 'tex/context/base/mkxl/util-fil.lmt')
-rw-r--r--tex/context/base/mkxl/util-fil.lmt18
1 files changed, 12 insertions, 6 deletions
diff --git a/tex/context/base/mkxl/util-fil.lmt b/tex/context/base/mkxl/util-fil.lmt
index 86200ebe5..b8d374755 100644
--- a/tex/context/base/mkxl/util-fil.lmt
+++ b/tex/context/base/mkxl/util-fil.lmt
@@ -27,15 +27,21 @@ function files.open(filename,zb)
end
function files.close(f)
- zerobased[f] = nil
- f:close()
+ if f then
+ zerobased[f] = nil
+ f:close()
+ end
end
function files.size(f)
- local current = f:seek()
- local size = f:seek("end")
- f:seek("set",current)
- return size
+ if f then
+ local current = f:seek()
+ local size = f:seek("end")
+ f:seek("set",current)
+ return size
+ else
+ return 0
+ end
end
files.getsize = files.size