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

Re: mapfile (Re: More ramblings Re: zsh/termcap and zsh/terminfo modules)



Bart wrote:
> Hmm, well, could this possibly be a result of scanpmmapfile() relying on
> the static buffer from metafy() that is returned by zreaddir() ?
> 
> I'm not sure whether the right thing to do about that is to dupstring() ?

That seems to work.  I'm now off for Easter.  Stay alert!

Index: Src/Modules/mapfile.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Modules/mapfile.c,v
retrieving revision 1.4
diff -u -r1.4 mapfile.c
--- Src/Modules/mapfile.c	2000/06/09 15:37:05	1.4
+++ Src/Modules/mapfile.c	2001/04/11 00:02:41
@@ -318,6 +318,7 @@
 	 * we always read the entire contents of every single file
 	 * in the directory into memory.  Hence just leave it empty.
 	 */
+	pm.nam = dupstring(pm.nam);
 	pm.u.str = "";
 	func((HashNode) &pm, flags);
     }

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



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