GC stack scanning cares about interior pointers

This commit is contained in:
Araq 2011-12-30 11:03:01 +01:00
commit 73919e3082
10 changed files with 328 additions and 29 deletions

View file

@ -1,7 +1,7 @@
#
#
# Nimrod's Runtime Library
# (c) Copyright 2008 Andreas Rumpf
# (c) Copyright 2011 Andreas Rumpf
#
# See the file "copying.txt", included in this
# distribution, for details about the copyright.
@ -145,7 +145,7 @@ iterator walkFiles*(z: var TZipArchive): string =
proc extractFile*(z: var TZipArchive, srcFile: string, dest: PStream) =
## extracts a file from the zip archive 'z' to the destination stream.
## extracts a file from the zip archive `z` to the destination stream.
var strm = getStream(z, srcFile)
while true:
if not strm.atEnd:
@ -155,15 +155,13 @@ proc extractFile*(z: var TZipArchive, srcFile: string, dest: PStream) =
strm.close()
proc extractFile*(z: var TZipArchive, srcFile: string, dest: string) =
## extracts a file from the zip archive 'z' to the destination filename.
## extracts a file from the zip archive `z` to the destination filename.
var file = newFileStream(dest, fmReadWrite)
extractFile(z, srcFile, file)
file.close()
proc extractAll*(z: var TZipArchive, dest: string) =
## extracts all files from archive 'z' to the destination directory.
## extracts all files from archive `z` to the destination directory.
for file in walkFiles(z):
extractFile(z, file, dest & "/" & extractFilename(file))
extractFile(z, file, dest / extractFilename(file))