winthotcompilers.c patch

I've attached a small patch which fixes problems with winthotcompilers.c

in the Amaya 1.4a distribution.

Hope it comes across okay.

-- Tim Baker
--- winthotcompilers-orig.c	Fri Jan 15 21:01:10 1999
+++ winthotcompilers-patch.c	Fri Jan 15 20:58:18 1999
@@ -656,14 +656,14 @@
                                          currentFile = (char*) 0;
 									  }
                                       if (SrcFileName) {
-                                         free (currentFile);
-                                         currentFile = (char*) 0;
+                                         free (SrcFileName);
+                                         SrcFileName = (char*) 0;
 									  }
                                       if (WorkFileName) {
-                                         free (currentFile);
-                                         currentFile = (char*) 0;
+                                         _unlink (WorkFileName);
+                                         free (WorkFileName);
+                                         WorkFileName = (char*) 0;
 									  }
-                                      _unlink (WorkFileName);
                                       if (result == FATAL_EXIT_CODE)
                                          return result;
                                       len = strlen (WorkPath);
@@ -806,14 +806,14 @@
                                          currentFile = (char*) 0;
 									  }
                                       if (SrcFileName) {
-                                         free (currentFile);
-                                         currentFile = (char*) 0;
+                                         free (SrcFileName);
+                                         SrcFileName = (char*) 0;
 									  }
                                       if (WorkFileName) {
-                                         free (currentFile);
-                                         currentFile = (char*) 0;
+                                         _unlink (WorkFileName);
+                                         free (WorkFileName);
+                                         WorkFileName = (char*) 0;
 									  }
-                                      _unlink (WorkFileName);
                                       if (result == FATAL_EXIT_CODE)
                                          return result;
                                       len = strlen (WorkPath);
@@ -857,7 +857,7 @@
                       SrcFileName = (char*) malloc (len + strlen (BinFiles[i]) + 1);
                       sprintf (SrcFileName, "%s%s", WorkPath, BinFiles [i]);
 				  } else {
-                         SrcFileName = (char*) malloc (len + strlen (BinFiles) + 2);
+                         SrcFileName = (char*) malloc (len + strlen (BinFiles [i]) + 2);
                          sprintf (SrcFileName, "%s\\%s", WorkPath, BinFiles [i]);
 				  }
                   _unlink (SrcFileName);

Received on Sunday, 17 January 1999 20:07:48 UTC