Fixed bug in COPY command

svn path=/trunk/; revision=1112
This commit is contained in:
Eric Kohl 2000-04-08 14:50:47 +00:00
parent 4be5d21243
commit 55c5bbf0be
6 changed files with 53 additions and 47 deletions

View file

@ -1,6 +1,6 @@
**** Please report bugs to ekohl@abo.rhein-zeitung.de! **** **** Please report bugs to ekohl@rz-online.de! ****
Known bugs in CMD version 0.0.4 Known bugs in CMD version 0.1
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
o let set work with or without the '=' sign. People like it that way. o let set work with or without the '=' sign. People like it that way.
@ -12,4 +12,4 @@ o command.com ignores control-c and control-break, which makes it difficult
o "alias v = dir" doesn't work because of the spaces. o "alias v = dir" doesn't work because of the spaces.
**** Please report bugs to ekohl@abo.rhein-zeitung.de! **** **** Please report bugs to ekohl@rz-online.de! ****

View file

@ -1,4 +1,4 @@
/* $Id: cmd.c,v 1.19 2000/02/18 00:53:11 ekohl Exp $ /* $Id: cmd.c,v 1.20 2000/04/08 14:50:47 ekohl Exp $
* *
* CMD.C - command-line interface. * CMD.C - command-line interface.
* *
@ -128,7 +128,7 @@
#include "batch.h" #include "batch.h"
#define CMDLINE_LENGTH 1024 #define CMDLINE_LENGTH 2048 //1024
BOOL bExit = FALSE; /* indicates EXIT was typed */ BOOL bExit = FALSE; /* indicates EXIT was typed */

View file

@ -22,7 +22,7 @@
/* Define to enable debugging code */ /* Define to enable debugging code */
/* #define _DEBUG */ //#define _DEBUG
/* Define to enable the alias command, and aliases.*/ /* Define to enable the alias command, and aliases.*/

View file

@ -1,4 +1,4 @@
/* $Id: copy.c,v 1.6 1999/12/24 17:20:54 ekohl Exp $ /* $Id: copy.c,v 1.7 2000/04/08 14:50:47 ekohl Exp $
* *
* COPY.C -- copy internal command. * COPY.C -- copy internal command.
* *
@ -484,7 +484,8 @@ int copy (LPTSTR source, LPTSTR dest, int append, LPDWORD lpdwFlags)
} }
int setup_copy (LPFILES sources, char **p, BOOL bMultiple, static INT
SetupCopy (LPFILES sources, char **p, BOOL bMultiple,
char *drive_d, char *dir_d, char *file_d, char *drive_d, char *dir_d, char *file_d,
char *ext_d, int *append, LPDWORD lpdwFlags) char *ext_d, int *append, LPDWORD lpdwFlags)
{ {
@ -504,6 +505,10 @@ int setup_copy (LPFILES sources, char **p, BOOL bMultiple,
BOOL bDone; BOOL bDone;
HANDLE hFind; HANDLE hFind;
#ifdef _DEBUG
DebugPrintf (_T("SetupCopy\n"));
#endif
real_source = (LPTSTR)malloc (MAX_PATH); real_source = (LPTSTR)malloc (MAX_PATH);
real_dest = (LPTSTR)malloc (MAX_PATH); real_dest = (LPTSTR)malloc (MAX_PATH);
@ -524,7 +529,6 @@ int setup_copy (LPFILES sources, char **p, BOOL bMultiple,
if (hFind == INVALID_HANDLE_VALUE) if (hFind == INVALID_HANDLE_VALUE)
{ {
error_file_not_found(); error_file_not_found();
DeleteFileList (sources);
freep(p); freep(p);
free(real_source); free(real_source);
free(real_dest); free(real_dest);
@ -703,7 +707,7 @@ INT cmd_copy (LPTSTR first, LPTSTR rest)
if (bDestFound && !bWildcards) if (bDestFound && !bWildcards)
{ {
copied = setup_copy (sources, p, bMultiple, drive_d, dir_d, file_d, ext_d, &append, &dwFlags); copied = SetupCopy (sources, p, bMultiple, drive_d, dir_d, file_d, ext_d, &append, &dwFlags);
} }
else if (bDestFound && bWildcards) else if (bDestFound && bWildcards)
{ {
@ -722,7 +726,7 @@ INT cmd_copy (LPTSTR first, LPTSTR rest)
file_d[0] = _T('\0'); file_d[0] = _T('\0');
ext_d[0] = _T('\0'); ext_d[0] = _T('\0');
} }
copied = setup_copy (sources, p, FALSE, "", "", file_d, ext_d, &append, &dwFlags); copied = SetupCopy (sources, p, FALSE, "", "", file_d, ext_d, &append, &dwFlags);
} }
else else
{ {
@ -737,7 +741,7 @@ INT cmd_copy (LPTSTR first, LPTSTR rest)
ConOutPuts (sources->szFile); ConOutPuts (sources->szFile);
append = 1; append = 1;
copied = setup_copy (sources->next, p, bMultiple, drive_d, dir_d, file_d, ext_d, &append, &dwFlags) + 1; copied = SetupCopy (sources->next, p, bMultiple, drive_d, dir_d, file_d, ext_d, &append, &dwFlags) + 1;
} }
DeleteFileList (sources); DeleteFileList (sources);

View file

@ -357,3 +357,7 @@ o Added and fixed missing help texts.
o Fixed bugs in MD and RD that crashed cmd when no directory was specified. o Fixed bugs in MD and RD that crashed cmd when no directory was specified.
o Improved history support. o Improved history support.
o Improved COLOR command. o Improved COLOR command.
09-Apr-2000 ReactOS CMD version 0.1 (EricKohl <ekohl@rz-online.de>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
o Fixed bug in COPY command. CMD crashed if source file didn't exist.

View file

@ -68,7 +68,7 @@ INT cmd_ver (LPTSTR cmd, LPTSTR param)
SHELLVER "\n" SHELLVER "\n"
"\n" "\n"
"Copyright (C) 1994-1998 Tim Norman and others.")); "Copyright (C) 1994-1998 Tim Norman and others."));
ConOutPuts (_T("Copyright (C) 1998,1999 Eric Kohl and others.")); ConOutPuts (_T("Copyright (C) 1998-2000 Eric Kohl and others."));
/* Basic copyright notice */ /* Basic copyright notice */
if (param[0] == _T('\0')) if (param[0] == _T('\0'))
@ -138,11 +138,9 @@ INT cmd_ver (LPTSTR cmd, LPTSTR param)
} }
} }
ConOutPuts (_T("\nSend bug reports to <ekohl@abo.rhein-zeitung.de>." ConOutPuts (_T("\n"
/* "Send bug reports to <ekohl@rz-online.de>.\n"
"\nUpdates are available at http://www.reactos.com" "Updates are available at: http://www.reactos.com"));
*/
));
return 0; return 0;
} }