mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 05:22:57 +00:00
Disabled prompting when in batch mode.
svn path=/trunk/; revision=737
This commit is contained in:
parent
788e4dc053
commit
863afe8930
1 changed files with 37 additions and 24 deletions
|
@ -16,6 +16,9 @@
|
||||||
*
|
*
|
||||||
* 26-Jan-1998 (Eric Kohl <ekohl@abo.rhein-zeitung.de>)
|
* 26-Jan-1998 (Eric Kohl <ekohl@abo.rhein-zeitung.de>)
|
||||||
* Replaced CRT io functions by Win32 io functions.
|
* Replaced CRT io functions by Win32 io functions.
|
||||||
|
*
|
||||||
|
* 27-Oct-1998 (Eric Kohl <ekohl@abo.rhein-zeitung.de>)
|
||||||
|
* Disabled prompting then used in batch mode.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
@ -29,6 +32,7 @@
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
|
||||||
#include "cmd.h"
|
#include "cmd.h"
|
||||||
|
#include "batch.h"
|
||||||
|
|
||||||
|
|
||||||
#define VERIFY 1 /* VERIFY Switch */
|
#define VERIFY 1 /* VERIFY Switch */
|
||||||
|
@ -270,6 +274,7 @@ ParseCommand (LPFILES f, int argc, char **arg, LPDWORD lpdwFlags)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef _DEBUG
|
#ifdef _DEBUG
|
||||||
DebugPrintf ("ParseCommand: flags has %s\n",
|
DebugPrintf ("ParseCommand: flags has %s\n",
|
||||||
*lpdwFlags & ASCII ? "ASCII" : "BINARY");
|
*lpdwFlags & ASCII ? "ASCII" : "BINARY");
|
||||||
|
@ -299,6 +304,7 @@ Overwrite (LPTSTR fn)
|
||||||
|
|
||||||
ConOutPrintf (_T("Overwrite %s (Yes/No/All)? "), fn);
|
ConOutPrintf (_T("Overwrite %s (Yes/No/All)? "), fn);
|
||||||
ConInString (inp, 10);
|
ConInString (inp, 10);
|
||||||
|
ConOutPuts (_T(""));
|
||||||
|
|
||||||
_tcsupr (inp);
|
_tcsupr (inp);
|
||||||
for (p = inp; _istspace (*p); p++)
|
for (p = inp; _istspace (*p); p++)
|
||||||
|
@ -417,8 +423,6 @@ int copy (LPTSTR source, LPTSTR dest, int append, LPDWORD lpdwFlags)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
ConOutPuts (source);
|
|
||||||
|
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
ReadFile (hFileSrc, buffer, BUFF_SIZE, &dwRead, NULL);
|
ReadFile (hFileSrc, buffer, BUFF_SIZE, &dwRead, NULL);
|
||||||
|
@ -484,10 +488,10 @@ int setup_copy (LPFILES sources, char **p, BOOL bMultiple,
|
||||||
{
|
{
|
||||||
WIN32_FIND_DATA find;
|
WIN32_FIND_DATA find;
|
||||||
|
|
||||||
char drive_s[_MAX_DRIVE],
|
char drive_s[_MAX_DRIVE];
|
||||||
dir_s[_MAX_DIR],
|
CHAR dir_s[_MAX_DIR];
|
||||||
file_s[_MAX_FNAME],
|
char file_s[_MAX_FNAME];
|
||||||
ext_s[_MAX_EXT];
|
char ext_s[_MAX_EXT];
|
||||||
char from_merge[_MAX_PATH];
|
char from_merge[_MAX_PATH];
|
||||||
|
|
||||||
LPTSTR real_source;
|
LPTSTR real_source;
|
||||||
|
@ -498,7 +502,6 @@ int setup_copy (LPFILES sources, char **p, BOOL bMultiple,
|
||||||
BOOL bDone;
|
BOOL bDone;
|
||||||
HANDLE hFind;
|
HANDLE hFind;
|
||||||
|
|
||||||
|
|
||||||
real_source = (LPTSTR)malloc (MAX_PATH);
|
real_source = (LPTSTR)malloc (MAX_PATH);
|
||||||
real_dest = (LPTSTR)malloc (MAX_PATH);
|
real_dest = (LPTSTR)malloc (MAX_PATH);
|
||||||
|
|
||||||
|
@ -556,7 +559,16 @@ int setup_copy (LPFILES sources, char **p, BOOL bMultiple,
|
||||||
|
|
||||||
if (IsValidFileName (real_dest) && !bAll)
|
if (IsValidFileName (real_dest) && !bAll)
|
||||||
{
|
{
|
||||||
int over = Overwrite (real_dest);
|
/* Don't prompt in a batch file */
|
||||||
|
if (bc != NULL)
|
||||||
|
{
|
||||||
|
bAll = TRUE;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
int over;
|
||||||
|
|
||||||
|
over = Overwrite (real_dest);
|
||||||
if (over == 2)
|
if (over == 2)
|
||||||
bAll = TRUE;
|
bAll = TRUE;
|
||||||
else if (over == 0)
|
else if (over == 0)
|
||||||
|
@ -564,6 +576,7 @@ int setup_copy (LPFILES sources, char **p, BOOL bMultiple,
|
||||||
else if (bMultiple)
|
else if (bMultiple)
|
||||||
bAll = TRUE;
|
bAll = TRUE;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (copy (real_source, real_dest, *append, lpdwFlags))
|
if (copy (real_source, real_dest, *append, lpdwFlags))
|
||||||
nCopied++;
|
nCopied++;
|
||||||
next:
|
next:
|
||||||
|
@ -588,15 +601,15 @@ int setup_copy (LPFILES sources, char **p, BOOL bMultiple,
|
||||||
INT cmd_copy (LPTSTR first, LPTSTR rest)
|
INT cmd_copy (LPTSTR first, LPTSTR rest)
|
||||||
{
|
{
|
||||||
char **p;
|
char **p;
|
||||||
char drive_d[_MAX_DRIVE],
|
char drive_d[_MAX_DRIVE];
|
||||||
dir_d[_MAX_DIR],
|
char dir_d[_MAX_DIR];
|
||||||
file_d[_MAX_FNAME],
|
char file_d[_MAX_FNAME];
|
||||||
ext_d[_MAX_EXT];
|
char ext_d[_MAX_EXT];
|
||||||
|
|
||||||
int argc,
|
int argc;
|
||||||
append,
|
int append;
|
||||||
files,
|
int files;
|
||||||
copied;
|
int copied;
|
||||||
|
|
||||||
LPFILES sources;
|
LPFILES sources;
|
||||||
FILES dest;
|
FILES dest;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue