diff options
author | Araq <rumpf_a@web.de> | 2011-11-05 12:16:49 +0100 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2011-11-05 12:16:49 +0100 |
commit | dc08a033d910aea19fde0f59c9d1a5e70d7efc15 (patch) | |
tree | 1bc7bae9bd75af8e0cc86d9f71ce6650638ba816 /compiler | |
parent | 25fbad98bcd61b9344d5cbf313da6788f1567373 (diff) | |
download | Nim-dc08a033d910aea19fde0f59c9d1a5e70d7efc15.tar.gz |
memfiles now uses winlean; changed the interface to raise EOS
Diffstat (limited to 'compiler')
-rwxr-xr-x | compiler/rodread.nim | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/compiler/rodread.nim b/compiler/rodread.nim index 0cc91140d..900361ed7 100755 --- a/compiler/rodread.nim +++ b/compiler/rodread.nim @@ -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) |