WCMD: Increase possible line length in batch processing

Uwe Bonnes bon at elektron.ikp.physik.tu-darmstadt.de
Wed Jul 24 06:18:13 CDT 2002


Changelog:
	programs/wcmd/batch.c:  WCMD_batch
	Increase possible line length and warn if still too small	
-- 
Uwe Bonnes                bon at elektron.ikp.physik.tu-darmstadt.de

Institut fuer Kernphysik  Schlossgartenstrasse 9  64289 Darmstadt
--------- Tel. 06151 162516 -------- Fax. 06151 164321 ----------
Index: wine/programs/wcmd/batch.c
===================================================================
RCS file: /home/wine/wine/programs/wcmd/batch.c,v
retrieving revision 1.8
diff -u -w -r1.8 batch.c
--- wine/programs/wcmd/batch.c	31 May 2002 23:40:59 -0000	1.8
+++ wine/programs/wcmd/batch.c	24 Jul 2002 11:17:08 -0000
@@ -30,6 +30,7 @@
 extern BATCH_CONTEXT *context;
 extern DWORD errorlevel;
 
+#define MAXSTRING 1024
 
 /****************************************************************************
  * WCMD_batch
@@ -47,7 +48,7 @@
 void WCMD_batch (char *file, char *command, int called) {
 
 HANDLE h;
-char string[MAX_PATH];
+char string[MAXSTRING];
 BATCH_CONTEXT *prev_context;
 
   strcpy (string, file);
@@ -77,6 +78,8 @@
  */
 
   while (WCMD_fgets (string, sizeof(string), h)) {
+    if (strlen(string) == MAXSTRING -1)
+      WCMD_output("Line in Batch processing possible truncated. Using:\n%s\n",string);
     if (string[0] != ':') {                      /* Skip over labels */
       WCMD_batch_command (string);
     }
@@ -108,7 +111,7 @@
 void WCMD_batch_command (char *line) {
 
 DWORD status;
-char cmd1[1024],cmd2[1024];
+char cmd1[MAXSTRING],cmd2[MAXSTRING];
 char *p, *s, *t;
 int i;
 



More information about the wine-patches mailing list