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

Re: Bugs with exclusion using file paths.



Sven Wischnowsky wrote:
> > +				if (buf) {
> >  				    zfree(buf, pathpos + patinlen);
> > +				    patinstart = savpatinstart;
> > +				    patinlen = savpatinlen;
> 
> With something like **/_*~*~ I now get lots of:
> 
>   BUG: attempt to free more than allocated.
> 
> warnings.

Very stupid, sorry; use the original pattern length, not the temporrary
one.  For boring technical reasons due to the way my front-end to configure
is run, I didn't have Zsh memory allocation on, or I would presumably have
picked it up.

Let me know if there is still a problem after this.  I tried **/*~(.)# in
my home directory, with zsh-mem turned on, which ought to have tickled any
bug of this kind.

Index: Src/pattern.c
===================================================================
RCS file: /home/pws/CVSROOT/projects/zsh/Src/pattern.c,v
retrieving revision 1.7
diff -u -r1.7 pattern.c
--- Src/pattern.c	2000/03/27 21:40:57	1.7
+++ Src/pattern.c	2000/03/28 20:16:50
@@ -1815,9 +1815,9 @@
 				    parsfound = savparsfound;
 				}
 				if (buf) {
-				    zfree(buf, pathpos + patinlen);
 				    patinstart = savpatinstart;
 				    patinlen = savpatinlen;
+				    zfree(buf, pathpos + patinlen);
 				}
 				if (!ret)
 				    break;

-- 
Peter Stephenson <pws@xxxxxxxxxxxxxxxxxxxxxxxx>
Work: pws@xxxxxxxxxxxxxxxxxxxxxxxxx
Web: http://www.pwstephenson.fsnet.co.uk



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