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

One more input fix



Here's another patch necessary for my input code: in this case, I
hadn't realised that join() maintains it's own memory and you
shouldn't free what it returns.  This was in the code for `eval'.  The
symptom is typically that the next PATH assignment after an eval will
give a message about a bad free (if you are using zsh's allocators
with checks enabled).

*** Src/builtin.c.join	Fri Sep 15 04:22:33 1995
--- Src/builtin.c	Mon Sep 18 16:03:18 1995
***************
*** 4509,4515 ****
  {
      List list;
  
!     inpush(join(argv, ' '), INP_FREE);
      strinbeg();
      if (!(list = parse_list())) {
  	strinend();
--- 4509,4518 ----
  {
      List list;
  
!     /* Safe not to copy join() return value, since join doesn't get
!      * used when parsing.
!      */
!     inpush(join(argv, ' '), 0);
      strinbeg();
      if (!(list = parse_list())) {
  	strinend();

-- 
Peter Stephenson <P.Stephenson@xxxxxxxxxxxxx>  Tel: +44 1792 205678 extn. 4461
WWW:  http://python.swan.ac.uk/~pypeters/      Fax: +44 1792 295324
Department of Physics, University of Wales, Swansea,
Singleton Park, Swansea, SA2 8PP, U.K.



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