🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by Jay Schuster Thu, 07 Jan 1993 00:31
Make-3.62 (and earlier) vpath bug (with fix)
#1267
Author: Jay Schuster
Date: Thu, 07 Jan 1993 00:31
48 lines
2232 bytes
Running GNU Make-3.62 on an IBM RS/6000 running AIX 3.2, using the
builtin alloca() through the -ma compiler flag.

The code in construct_vpath_list in vpath.c that deletes items out of
the vpaths list does not work correctly.  When given a `vpath'
directive with no pattern or search path, it should delete everything
out of the list.  It does do that, but leaves the vpaths variable
pointing to freed space, thus messing up any future vpath
additions.  In our case, it was creating a circular list (which
iterated forever, or, when I had linked with the C-alloca, ate up
all the swapspace while doing so).

This patch fixes the problem:

--- ./vpath.c~	Wed Jan  6 18:11:39 1993
+++ ./vpath.c	Wed Jan  6 19:20:34 1993
@@ -124,8 +124,8 @@
       /* Remove matching listings.  */
       register struct vpath *path, *lastpath;
 
-      lastpath = vpaths;
-      for (path = vpaths; path != 0; lastpath = path, path = path->next)
+      lastpath = NULL;
+      for (path = vpaths; path != 0; path = path->next)
 	if (pattern == 0
 	    || (((percent == 0 && path->percent == 0)
 		 || (percent - pattern == path->percent - path->pattern))
@@ -132,7 +132,7 @@
 		&& streq (pattern, path->pattern)))
 	  {
 	    /* Remove it from the linked list.  */
-	    if (lastpath == vpaths)
+	    if (lastpath == NULL)
 	      vpaths = path->next;
 	    else
 	      lastpath->next = path->next;
@@ -142,6 +142,8 @@
 	    free ((char *) path->searchpath);
 	    free ((char *) path);
 	  }
+	else
+	  lastpath = path;
       if (pattern != 0)
 	free (pattern);
       return;
-- 
Jay Schuster <jay@pcc.COM>	uunet!uvm-gen!banzai!jay, attmail!banzai!jay
The People's Computer Company	`Revolutionary Programming'
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads