🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by Alexander Dupuy Wed, 27 Sep 1989 20:19
Wrong memory freed in GNUmake 3.55
#447
Author: Alexander Dupuy
Date: Wed, 27 Sep 1989 20:19
79 lines
2645 bytes
> From: davida@isil.ai.mit.edu (David Axmark)
> Newsgroups: gnu.utils.bug

> Another smaller bug.
> If patsubst is used without a % in the pattern as in the following makefile.

> all:;	echo $(patsubst /,, $(dir doo/ddd))

> On my system make loops on this makefile and takes all my memory... 

Here's a fix, which includes your patches to function.c (yours were reversed
normal diffs - context diffs are preferable).  The first hunk is the fix for
looping, the rest are your fix for freeing wrong memory.

RCS file: src/RCS/function.c,v
retrieving revision 3.56
diff -c -r3.56 src/function.c
*** /tmp/,RCSt1a08524	Wed Sep 27 16:14:13 1989
--- src/function.c	Wed Sep 27 15:49:59 1989
***************
*** 67,73 ****
  	  /* Struck out.  Output the rest of the string that is
  	     no longer to be replaced.  */
  	  o = variable_buffer_output (o, subst, slen);
! 	  continue;
  	}
  
        /* Advance T past the string to be replaced.  */
--- 67,75 ----
  	  /* Struck out.  Output the rest of the string that is
  	     no longer to be replaced.  */
  	  o = variable_buffer_output (o, subst, slen);
! 	  /* Advance T past the string to be replaced.  */
! 	  t = p + slen;
!   	  continue;
  	}
  
        /* Advance T past the string to be replaced.  */
***************
*** 860,866 ****
  	BADARGS ("word");
        text = expand_argument (text, p);
  
!       p = expand_argument (p + 1, end);
  
        /* Check the first argument.  */
        for (p2 = text; *p2 != '\0'; ++p2)
--- 862,869 ----
  	BADARGS ("word");
        text = expand_argument (text, p);
  
!       p3 = expand_argument (p + 1, end);
!       p = p3;
  
        /* Check the first argument.  */
        for (p2 = text; *p2 != '\0'; ++p2)
***************
*** 881,887 ****
  	o = variable_buffer_output (o, p, len);
  
        free (text);
!       free (p);
        break;
  
      case function_words:
--- 884,890 ----
  	o = variable_buffer_output (o, p, len);
  
        free (text);
!       free (p3);
        break;
  
      case function_words:


@alex
-- 
inet: dupuy@cs.columbia.edu
uucp: ...!rutgers!cs.columbia.edu!dupuy
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