mirror of
https://github.com/dschmenk/PLASMA.git
synced 2025-02-03 22:35:52 +00:00
Fix copy directory destination
This commit is contained in:
parent
b2eaa867eb
commit
18543c8363
@ -9,6 +9,7 @@ var arg, exit, srcfilelist, srcfileptr, srccnt
|
||||
var copybuff, copyrel, copysize
|
||||
byte recurse, dstlen
|
||||
char[64] curpath, dstpath
|
||||
char[16] srcdir
|
||||
res[t_fileinfo] srcfileinfo, dstfileinfo
|
||||
//
|
||||
// Copy path with upper case conversion
|
||||
@ -245,11 +246,18 @@ if not except(exit)
|
||||
//
|
||||
srcfileptr = srcfilelist
|
||||
while srccnt
|
||||
dstlen = dstpath
|
||||
if fileio:getfileinfo(srcfileptr, @srcfileinfo) == FILE_ERR_OK and srcfileinfo.file_type == $0F
|
||||
if recurse
|
||||
//
|
||||
// Copy directory
|
||||
//
|
||||
if dstpath[dstpath] <> '/'
|
||||
dstpath++
|
||||
dstpath[dstpath] = '/'
|
||||
fin
|
||||
filefrompath(@srcdir, srcfileptr)
|
||||
strcat(@dstpath, @srcdir)
|
||||
if fileio:getfileinfo(@dstpath, @dstfileinfo) <> FILE_ERR_OK
|
||||
fileio:create(@dstpath, $0F, $0000)
|
||||
fin
|
||||
@ -268,6 +276,7 @@ if not except(exit)
|
||||
// Copy files
|
||||
//
|
||||
copyfiles(srcfileptr, @dstpath)
|
||||
dstpath = dstlen
|
||||
srcfileptr = srcfileptr + ^srcfileptr + 1
|
||||
srccnt--
|
||||
loop
|
||||
|
Loading…
x
Reference in New Issue
Block a user