Author: cwittich
Date: Thu Jan 31 12:00:27 2008
New Revision: 32062
URL:
http://svn.reactos.org/svn/reactos?rev=32062&view=rev
Log:
don't try to append when there is only one parameter given
See issue #3023 for more details.
Modified:
trunk/reactos/base/shell/cmd/copy.c
Modified: trunk/reactos/base/shell/cmd/copy.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/copy.c?rev=…
==============================================================================
--- trunk/reactos/base/shell/cmd/copy.c (original)
+++ trunk/reactos/base/shell/cmd/copy.c Thu Jan 31 12:00:27 2008
@@ -539,17 +539,20 @@
return 1;
}
- if(((_tcschr (arg[nSrc], _T('+')) != NULL) ||
- (_tcschr (arg[nSrc], _T('*')) != NULL && _tcschr (arg[nDes],
_T('*')) == NULL) ||
- (IsExistingDirectory (arg[nSrc]) && (_tcschr (arg[nDes], _T('*'))
== NULL && !IsExistingDirectory (arg[nDes])))
- ))
- {
- /* There is a + in the source filename, this means
- that there is more then one file being put into
- one file. */
- bAppend = TRUE;
- if(_tcschr (arg[nSrc], _T('+')) != NULL)
- appendPointer = arg[nSrc];
+ if (nDes != -1) /* you can only append files when there is a destination */
+ {
+ if(((_tcschr (arg[nSrc], _T('+')) != NULL) ||
+ (_tcschr (arg[nSrc], _T('*')) != NULL && _tcschr (arg[nDes],
_T('*')) == NULL) ||
+ (IsExistingDirectory (arg[nSrc]) && (_tcschr (arg[nDes],
_T('*')) == NULL && !IsExistingDirectory (arg[nDes])))
+ ))
+ {
+ /* There is a + in the source filename, this means
+ that there is more then one file being put into
+ one file. */
+ bAppend = TRUE;
+ if(_tcschr (arg[nSrc], _T('+')) != NULL)
+ appendPointer = arg[nSrc];
+ }
}
/* Reusing the number of files variable */