winetest: try using a stable temp dir (take 2)

Ferenc Wagner wferi at tba.elte.hu
Tue Mar 29 07:05:25 CST 2005


With a (hopefully) correctly formatted patch now.

ChangeLog: Try using a stable temporary directory at first
           to silence ZoneAlarm warnings.

Feri.

Index: programs/winetest/main.c
===================================================================
RCS file: /home/wine/wine/programs/winetest/main.c,v
retrieving revision 1.31
diff -u -r1.31 main.c
--- programs/winetest/main.c	25 Mar 2005 17:11:52 -0000	1.31
+++ programs/winetest/main.c	29 Mar 2005 12:57:35 -0000
@@ -432,7 +432,7 @@
 run_tests (char *logname, const char *tag)
 {
     int nr_of_files = 0, nr_of_tests = 0, i;
-    char *tempdir;
+    char *tempdir, *shorttempdir;
     int logfile;
     char *strres, *eol, *nextline;
     DWORD strsize;
@@ -459,9 +459,17 @@
     tempdir = tempnam (0, "wct");
     if (!tempdir)
         report (R_FATAL, "Can't name temporary dir (check %%TEMP%%).");
-    report (R_DIR, tempdir);
-    if (!CreateDirectory (tempdir, NULL))
+    shorttempdir = strdup (tempdir);
+    if (shorttempdir) {         /* try stable path for ZoneAlarm */
+        strstr (shorttempdir, "wct")[3] = 0;
+        if (CreateDirectoryA (shorttempdir, NULL)) {
+            free (tempdir);
+            tempdir = shorttempdir;
+        } else free (shorttempdir);
+    }
+    if (tempdir != shorttempdir && !CreateDirectoryA (tempdir, NULL))
         report (R_FATAL, "Could not create directory: %s", tempdir);
+    report (R_DIR, tempdir);
 
     xprintf ("Version 3\n");
     strres = extract_rcdata (WINE_BUILD, STRINGRES, &strsize);



More information about the wine-patches mailing list