From 4ecc4b94c95cf0326c65804c809fdb96191bcfa3 Mon Sep 17 00:00:00 2001 From: Magnus Olsen Date: Thu, 21 Jul 2005 14:15:42 +0000 Subject: [PATCH] Fix copy /B filename + , , bug (touch) and fix whitespace for copy /B file + file + file2 by Brandon Turner svn path=/trunk/; revision=16679 --- reactos/subsys/system/cmd/copy.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/reactos/subsys/system/cmd/copy.c b/reactos/subsys/system/cmd/copy.c index 2caeb60e547..8d4d105f51d 100644 --- a/reactos/subsys/system/cmd/copy.c +++ b/reactos/subsys/system/cmd/copy.c @@ -518,9 +518,21 @@ INT cmd_copy (LPTSTR cmd, LPTSTR param) { /*if it isnt a switch then it is the source or destination*/ if(nSrc == -1) + { nSrc = i; + } + else if(*arg[i] == _T('+') || *arg[i] == _T(',')) + { + /* Add these onto the source string + this way we can do all checks + directly on source string later on */ + _tcscat(arg[nSrc],arg[i]); + nFiles--; + } else if(nDes == -1) + { nDes = i; + } } } @@ -842,8 +854,10 @@ INT cmd_copy (LPTSTR cmd, LPTSTR param) LoadString(CMD_ModuleHandle, STRING_COPY_FILE, szMsg, RC_STRING_MAX_SIZE); ConOutPrintf(szMsg, nFiles); - CloseHandle(hFile); - freep (arg); + CloseHandle(hFile); + if (arg!=NULL) + free(arg); + return 0; }