*
* 26-Jan-1998 (Eric Kohl <ekohl@abo.rhein-zeitung.de>)
* 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 <ctype.h>
#include "cmd.h"
+#include "batch.h"
#define VERIFY 1 /* VERIFY Switch */
static BOOL
GetDestination (LPFILES f, LPFILES dest)
{
- LPFILES p = NULL;
+ LPFILES p = NULL;
LPFILES start = f;
while (f->next != NULL)
}
}
}
+
#ifdef _DEBUG
DebugPrintf ("ParseCommand: flags has %s\n",
*lpdwFlags & ASCII ? "ASCII" : "BINARY");
ConOutPrintf (_T("Overwrite %s (Yes/No/All)? "), fn);
ConInString (inp, 10);
+ ConOutPuts (_T(""));
_tcsupr (inp);
for (p = inp; _istspace (*p); p++)
return 0;
}
- ConOutPuts (source);
-
do
{
ReadFile (hFileSrc, buffer, BUFF_SIZE, &dwRead, NULL);
{
WIN32_FIND_DATA find;
- char drive_s[_MAX_DRIVE],
- dir_s[_MAX_DIR],
- file_s[_MAX_FNAME],
- ext_s[_MAX_EXT];
- char from_merge[_MAX_PATH];
+ char drive_s[_MAX_DRIVE];
+ CHAR dir_s[_MAX_DIR];
+ char file_s[_MAX_FNAME];
+ char ext_s[_MAX_EXT];
+ char from_merge[_MAX_PATH];
LPTSTR real_source;
LPTSTR real_dest;
BOOL bDone;
HANDLE hFind;
-
real_source = (LPTSTR)malloc (MAX_PATH);
real_dest = (LPTSTR)malloc (MAX_PATH);
if (IsValidFileName (real_dest) && !bAll)
{
- int over = Overwrite (real_dest);
- if (over == 2)
- bAll = TRUE;
- else if (over == 0)
- goto next;
- else if (bMultiple)
+ /* Don't prompt in a batch file */
+ if (bc != NULL)
+ {
bAll = TRUE;
+ }
+ else
+ {
+ int over;
+
+ over = Overwrite (real_dest);
+ if (over == 2)
+ bAll = TRUE;
+ else if (over == 0)
+ goto next;
+ else if (bMultiple)
+ bAll = TRUE;
+ }
}
if (copy (real_source, real_dest, *append, lpdwFlags))
nCopied++;
INT cmd_copy (LPTSTR first, LPTSTR rest)
{
- char **p;
- char drive_d[_MAX_DRIVE],
- dir_d[_MAX_DIR],
- file_d[_MAX_FNAME],
- ext_d[_MAX_EXT];
-
- int argc,
- append,
- files,
- copied;
+ char **p;
+ char drive_d[_MAX_DRIVE];
+ char dir_d[_MAX_DIR];
+ char file_d[_MAX_FNAME];
+ char ext_d[_MAX_EXT];
+
+ int argc;
+ int append;
+ int files;
+ int copied;
LPFILES sources;
FILES dest;