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 */
Author: cwittich
Date: Wed Jan 30 19:02:49 2008
New Revision: 32056
URL: http://svn.reactos.org/svn/reactos?rev=32056&view=rev
Log:
use FILE_SHARE_READ | FILE_SHARE_WRITE to open files which are in use by another process
See issue #3011 for more details.
Modified:
trunk/reactos/base/applications/notepad/dialog.c
Modified: trunk/reactos/base/applications/notepad/dialog.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/notepad/…
==============================================================================
--- trunk/reactos/base/applications/notepad/dialog.c (original)
+++ trunk/reactos/base/applications/notepad/dialog.c Wed Jan 30 19:02:49 2008
@@ -289,7 +289,7 @@
if (!DoCloseFile())
return;
- hFile = CreateFile(szFileName, GENERIC_READ, FILE_SHARE_READ, NULL,
+ hFile = CreateFile(szFileName, GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL,
OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
if (hFile == INVALID_HANDLE_VALUE)
{