Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Another missing HEAPALLOC



% echo $zs
/home/sgi/pws/src/zsh-3.0.1/Src
% cd zs
BUG: permanent allocation in getstrvalue
~zs

PERMALLOC is set in bin_cd for calling cd_get_dest(), but the
parameter code in getnamedir() needs HEAPALLOC.  (Is this
getstrvalue() test new?  I've only just started noticing the error
messages.)  The following patch is chosen simply to make the minimum
code reorganisation necessary, but maybe the HEAPALLOC needs to be
further down in getstrvalue() or wherever, as Zoltan suggested.

*** Src/builtin.c~	Mon Dec  9 17:57:22 1996
--- Src/builtin.c	Tue Dec 10 09:48:52 1996
***************
*** 1180,1186 ****
  	for (rest = s; *rest && *rest != '/'; rest++);
  	save = *rest;
  	*rest = 0;
! 	s = getnameddir(s);
  	*rest = save;
  
  	if (s && *rest)
--- 1180,1188 ----
  	for (rest = s; *rest && *rest != '/'; rest++);
  	save = *rest;
  	*rest = 0;
! 	HEAPALLOC {
! 	    s = getnameddir(s);
! 	} LASTALLOC;
  	*rest = save;
  
  	if (s && *rest)

-- 
Peter Stephenson <pws@xxxxxx>       Tel: +49 33762 77366
WWW:  http://www.ifh.de/~pws/       Fax: +49 33762 77413
Deutches Electronen-Synchrotron --- Institut fuer Hochenergiephysik Zeuthen
DESY-IfH, 15735 Zeuthen, Germany.



Messages sorted by: Reverse Date, Date, Thread, Author