Karsten Hopp 54a597
To: vim_dev@googlegroups.com
Karsten Hopp 54a597
Subject: Patch 7.4.139
Karsten Hopp 54a597
Fcc: outbox
Karsten Hopp 54a597
From: Bram Moolenaar <Bram@moolenaar.net>
Karsten Hopp 54a597
Mime-Version: 1.0
Karsten Hopp 54a597
Content-Type: text/plain; charset=UTF-8
Karsten Hopp 54a597
Content-Transfer-Encoding: 8bit
Karsten Hopp 54a597
------------
Karsten Hopp 54a597
Karsten Hopp 54a597
Patch 7.4.139
Karsten Hopp 54a597
Problem:    Crash when using :cd in autocommand. (François Ingelrest)
Karsten Hopp 54a597
Solution:   Set w_localdir to NULL after freeing it. (Dominique Pelle)
Karsten Hopp 54a597
Files:	    src/ex_docmd.c, src/window.c
Karsten Hopp 54a597
Karsten Hopp 54a597
Karsten Hopp 54a597
*** ../vim-7.4.138/src/ex_docmd.c	2013-12-14 13:06:13.000000000 +0100
Karsten Hopp 54a597
--- src/ex_docmd.c	2014-01-10 15:39:58.000000000 +0100
Karsten Hopp 54a597
***************
Karsten Hopp 54a597
*** 8228,8233 ****
Karsten Hopp 54a597
--- 8228,8234 ----
Karsten Hopp 54a597
      int		local;
Karsten Hopp 54a597
  {
Karsten Hopp 54a597
      vim_free(curwin->w_localdir);
Karsten Hopp 54a597
+     curwin->w_localdir = NULL;
Karsten Hopp 54a597
      if (local)
Karsten Hopp 54a597
      {
Karsten Hopp 54a597
  	/* If still in global directory, need to remember current
Karsten Hopp 54a597
***************
Karsten Hopp 54a597
*** 8244,8250 ****
Karsten Hopp 54a597
  	 * name. */
Karsten Hopp 54a597
  	vim_free(globaldir);
Karsten Hopp 54a597
  	globaldir = NULL;
Karsten Hopp 54a597
- 	curwin->w_localdir = NULL;
Karsten Hopp 54a597
      }
Karsten Hopp 54a597
  
Karsten Hopp 54a597
      shorten_fnames(TRUE);
Karsten Hopp 54a597
--- 8245,8250 ----
Karsten Hopp 54a597
*** ../vim-7.4.138/src/window.c	2013-08-14 17:11:14.000000000 +0200
Karsten Hopp 54a597
--- src/window.c	2014-01-10 15:39:58.000000000 +0100
Karsten Hopp 54a597
***************
Karsten Hopp 54a597
*** 1216,1223 ****
Karsten Hopp 54a597
      else
Karsten Hopp 54a597
  	copy_loclist(oldp, newp);
Karsten Hopp 54a597
  #endif
Karsten Hopp 54a597
!     if (oldp->w_localdir != NULL)
Karsten Hopp 54a597
! 	newp->w_localdir = vim_strsave(oldp->w_localdir);
Karsten Hopp 54a597
  
Karsten Hopp 54a597
      /* copy tagstack and folds */
Karsten Hopp 54a597
      for (i = 0; i < oldp->w_tagstacklen; i++)
Karsten Hopp 54a597
--- 1216,1223 ----
Karsten Hopp 54a597
      else
Karsten Hopp 54a597
  	copy_loclist(oldp, newp);
Karsten Hopp 54a597
  #endif
Karsten Hopp 54a597
!     newp->w_localdir = (oldp->w_localdir == NULL)
Karsten Hopp 54a597
! 				    ? NULL : vim_strsave(oldp->w_localdir);
Karsten Hopp 54a597
  
Karsten Hopp 54a597
      /* copy tagstack and folds */
Karsten Hopp 54a597
      for (i = 0; i < oldp->w_tagstacklen; i++)
Karsten Hopp 54a597
*** ../vim-7.4.138/src/version.c	2014-01-10 15:32:17.000000000 +0100
Karsten Hopp 54a597
--- src/version.c	2014-01-10 15:39:48.000000000 +0100
Karsten Hopp 54a597
***************
Karsten Hopp 54a597
*** 740,741 ****
Karsten Hopp 54a597
--- 740,743 ----
Karsten Hopp 54a597
  {   /* Add new patch number below this line */
Karsten Hopp 54a597
+ /**/
Karsten Hopp 54a597
+     139,
Karsten Hopp 54a597
  /**/
Karsten Hopp 54a597
Karsten Hopp 54a597
-- 
Karsten Hopp 54a597
hundred-and-one symptoms of being an internet addict:
Karsten Hopp 54a597
132. You come back and check this list every half-hour.
Karsten Hopp 54a597
Karsten Hopp 54a597
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
Karsten Hopp 54a597
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
Karsten Hopp 54a597
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
Karsten Hopp 54a597
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///