1
0
mirror of https://github.com/dschmenk/PLASMA.git synced 2024-07-01 07:29:32 +00:00

Fix copy directory destination

This commit is contained in:
Dave Schmenk 2020-01-03 14:19:38 -08:00
parent b2eaa867eb
commit 18543c8363

View File

@ -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