memfiles now uses winlean; changed the interface to raise EOS
This commit is contained in:
parent
25fbad98bc
commit
dc08a033d9
8 changed files with 123 additions and 70 deletions
|
|
@ -632,7 +632,10 @@ proc newRodReader(modfilename: string, crc: TCrc32,
|
|||
r.readerIndex = readerIndex
|
||||
r.filename = modfilename
|
||||
InitIdTable(r.syms)
|
||||
if not open(r.memFile, modfilename): return nil
|
||||
try:
|
||||
r.memFile = memfiles.open(modfilename)
|
||||
except EOS:
|
||||
return nil
|
||||
# we terminate the file explicitely with ``\0``, so the cast to `cstring`
|
||||
# is save:
|
||||
r.s = cast[cstring](r.memFile.mem)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue