[ros-diffs] [greatlrd] 16679: Fix copy /B filename + , , bug (touch) and fix whitespace for copy /B file + file + file2

greatlrd at svn.reactos.com greatlrd at svn.reactos.com
Thu Jul 21 16:16:25 CEST 2005


Fix copy /B filename + ,            ,  bug (touch) and fix whitespace
for copy /B file +         file  + file2 
by Brandon Turner
Modified: trunk/reactos/subsys/system/cmd/copy.c
  _____  

Modified: trunk/reactos/subsys/system/cmd/copy.c
--- trunk/reactos/subsys/system/cmd/copy.c	2005-07-21 13:55:36 UTC
(rev 16678)
+++ trunk/reactos/subsys/system/cmd/copy.c	2005-07-21 14:15:42 UTC
(rev 16679)
@@ -518,9 +518,21 @@

 		{
 			/*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 @@
 	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;
 }
  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.reactos.org/pipermail/ros-diffs/attachments/20050721/847844f0/attachment.html


More information about the Ros-diffs mailing list