3ef2ca
To: vim_dev@googlegroups.com
3ef2ca
Subject: Patch 7.4.108
3ef2ca
Fcc: outbox
3ef2ca
From: Bram Moolenaar <Bram@moolenaar.net>
3ef2ca
Mime-Version: 1.0
3ef2ca
Content-Type: text/plain; charset=UTF-8
3ef2ca
Content-Transfer-Encoding: 8bit
3ef2ca
------------
3ef2ca
3ef2ca
Patch 7.4.108
3ef2ca
Problem:    "zG" and "zW" leave temp files around on MS-Windows.
3ef2ca
Solution:   Delete the temp files when exiting. (Ken Takata)
3ef2ca
Files:	    src/memline.c, src/proto/spell.pro, src/spell.c
3ef2ca
3ef2ca
3ef2ca
*** ../vim-7.4.107/src/memline.c	2013-11-04 02:53:46.000000000 +0100
3ef2ca
--- src/memline.c	2013-11-28 17:27:06.000000000 +0100
3ef2ca
***************
3ef2ca
*** 841,848 ****
3ef2ca
      for (buf = firstbuf; buf != NULL; buf = buf->b_next)
3ef2ca
  	ml_close(buf, del_file && ((buf->b_flags & BF_PRESERVED) == 0
3ef2ca
  				 || vim_strchr(p_cpo, CPO_PRESERVE) == NULL));
3ef2ca
  #ifdef TEMPDIRNAMES
3ef2ca
!     vim_deltempdir();	    /* delete created temp directory */
3ef2ca
  #endif
3ef2ca
  }
3ef2ca
  
3ef2ca
--- 841,851 ----
3ef2ca
      for (buf = firstbuf; buf != NULL; buf = buf->b_next)
3ef2ca
  	ml_close(buf, del_file && ((buf->b_flags & BF_PRESERVED) == 0
3ef2ca
  				 || vim_strchr(p_cpo, CPO_PRESERVE) == NULL));
3ef2ca
+ #ifdef FEAT_SPELL
3ef2ca
+     spell_delete_wordlist();	/* delete the internal wordlist */
3ef2ca
+ #endif
3ef2ca
  #ifdef TEMPDIRNAMES
3ef2ca
!     vim_deltempdir();		/* delete created temp directory */
3ef2ca
  #endif
3ef2ca
  }
3ef2ca
  
3ef2ca
*** ../vim-7.4.107/src/proto/spell.pro	2013-08-10 13:37:26.000000000 +0200
3ef2ca
--- src/proto/spell.pro	2013-11-28 17:25:59.000000000 +0100
3ef2ca
***************
3ef2ca
*** 3,8 ****
3ef2ca
--- 3,9 ----
3ef2ca
  int spell_move_to __ARGS((win_T *wp, int dir, int allwords, int curline, hlf_T *attrp));
3ef2ca
  void spell_cat_line __ARGS((char_u *buf, char_u *line, int maxlen));
3ef2ca
  char_u *did_set_spelllang __ARGS((win_T *wp));
3ef2ca
+ void spell_delete_wordlist __ARGS((void));
3ef2ca
  void spell_free_all __ARGS((void));
3ef2ca
  void spell_reload __ARGS((void));
3ef2ca
  int spell_check_msm __ARGS((void));
3ef2ca
*** ../vim-7.4.107/src/spell.c	2013-11-21 17:42:26.000000000 +0100
3ef2ca
--- src/spell.c	2013-11-28 17:25:59.000000000 +0100
3ef2ca
***************
3ef2ca
*** 2180,2188 ****
3ef2ca
      char_u	*endp;
3ef2ca
      hlf_T	attr;
3ef2ca
      int		len;
3ef2ca
! # ifdef FEAT_SYN_HL
3ef2ca
      int		has_syntax = syntax_present(wp);
3ef2ca
! # endif
3ef2ca
      int		col;
3ef2ca
      int		can_spell;
3ef2ca
      char_u	*buf = NULL;
3ef2ca
--- 2180,2188 ----
3ef2ca
      char_u	*endp;
3ef2ca
      hlf_T	attr;
3ef2ca
      int		len;
3ef2ca
! #ifdef FEAT_SYN_HL
3ef2ca
      int		has_syntax = syntax_present(wp);
3ef2ca
! #endif
3ef2ca
      int		col;
3ef2ca
      int		can_spell;
3ef2ca
      char_u	*buf = NULL;
3ef2ca
***************
3ef2ca
*** 2280,2286 ****
3ef2ca
  						     : p - buf)
3ef2ca
  						  > wp->w_cursor.col)))
3ef2ca
  		    {
3ef2ca
! # ifdef FEAT_SYN_HL
3ef2ca
  			if (has_syntax)
3ef2ca
  			{
3ef2ca
  			    col = (int)(p - buf);
3ef2ca
--- 2280,2286 ----
3ef2ca
  						     : p - buf)
3ef2ca
  						  > wp->w_cursor.col)))
3ef2ca
  		    {
3ef2ca
! #ifdef FEAT_SYN_HL
3ef2ca
  			if (has_syntax)
3ef2ca
  			{
3ef2ca
  			    col = (int)(p - buf);
3ef2ca
***************
3ef2ca
*** 4701,4707 ****
3ef2ca
      return flags;
3ef2ca
  }
3ef2ca
  
3ef2ca
! # if defined(FEAT_MBYTE) || defined(EXITFREE) || defined(PROTO)
3ef2ca
  /*
3ef2ca
   * Free all languages.
3ef2ca
   */
3ef2ca
--- 4701,4725 ----
3ef2ca
      return flags;
3ef2ca
  }
3ef2ca
  
3ef2ca
! /*
3ef2ca
!  * Delete the internal wordlist and its .spl file.
3ef2ca
!  */
3ef2ca
!     void
3ef2ca
! spell_delete_wordlist()
3ef2ca
! {
3ef2ca
!     char_u	fname[MAXPATHL];
3ef2ca
! 
3ef2ca
!     if (int_wordlist != NULL)
3ef2ca
!     {
3ef2ca
! 	mch_remove(int_wordlist);
3ef2ca
! 	int_wordlist_spl(fname);
3ef2ca
! 	mch_remove(fname);
3ef2ca
! 	vim_free(int_wordlist);
3ef2ca
! 	int_wordlist = NULL;
3ef2ca
!     }
3ef2ca
! }
3ef2ca
! 
3ef2ca
! #if defined(FEAT_MBYTE) || defined(EXITFREE) || defined(PROTO)
3ef2ca
  /*
3ef2ca
   * Free all languages.
3ef2ca
   */
3ef2ca
***************
3ef2ca
*** 4710,4716 ****
3ef2ca
  {
3ef2ca
      slang_T	*slang;
3ef2ca
      buf_T	*buf;
3ef2ca
-     char_u	fname[MAXPATHL];
3ef2ca
  
3ef2ca
      /* Go through all buffers and handle 'spelllang'. <VN> */
3ef2ca
      for (buf = firstbuf; buf != NULL; buf = buf->b_next)
3ef2ca
--- 4728,4733 ----
3ef2ca
***************
3ef2ca
*** 4723,4746 ****
3ef2ca
  	slang_free(slang);
3ef2ca
      }
3ef2ca
  
3ef2ca
!     if (int_wordlist != NULL)
3ef2ca
!     {
3ef2ca
! 	/* Delete the internal wordlist and its .spl file */
3ef2ca
! 	mch_remove(int_wordlist);
3ef2ca
! 	int_wordlist_spl(fname);
3ef2ca
! 	mch_remove(fname);
3ef2ca
! 	vim_free(int_wordlist);
3ef2ca
! 	int_wordlist = NULL;
3ef2ca
!     }
3ef2ca
  
3ef2ca
      vim_free(repl_to);
3ef2ca
      repl_to = NULL;
3ef2ca
      vim_free(repl_from);
3ef2ca
      repl_from = NULL;
3ef2ca
  }
3ef2ca
! # endif
3ef2ca
  
3ef2ca
! # if defined(FEAT_MBYTE) || defined(PROTO)
3ef2ca
  /*
3ef2ca
   * Clear all spelling tables and reload them.
3ef2ca
   * Used after 'encoding' is set and when ":mkspell" was used.
3ef2ca
--- 4740,4755 ----
3ef2ca
  	slang_free(slang);
3ef2ca
      }
3ef2ca
  
3ef2ca
!     spell_delete_wordlist();
3ef2ca
  
3ef2ca
      vim_free(repl_to);
3ef2ca
      repl_to = NULL;
3ef2ca
      vim_free(repl_from);
3ef2ca
      repl_from = NULL;
3ef2ca
  }
3ef2ca
! #endif
3ef2ca
  
3ef2ca
! #if defined(FEAT_MBYTE) || defined(PROTO)
3ef2ca
  /*
3ef2ca
   * Clear all spelling tables and reload them.
3ef2ca
   * Used after 'encoding' is set and when ":mkspell" was used.
3ef2ca
***************
3ef2ca
*** 4773,4779 ****
3ef2ca
  	}
3ef2ca
      }
3ef2ca
  }
3ef2ca
! # endif
3ef2ca
  
3ef2ca
  /*
3ef2ca
   * Reload the spell file "fname" if it's loaded.
3ef2ca
--- 4782,4788 ----
3ef2ca
  	}
3ef2ca
      }
3ef2ca
  }
3ef2ca
! #endif
3ef2ca
  
3ef2ca
  /*
3ef2ca
   * Reload the spell file "fname" if it's loaded.
3ef2ca
*** ../vim-7.4.107/src/version.c	2013-11-28 17:04:38.000000000 +0100
3ef2ca
--- src/version.c	2013-11-28 17:26:31.000000000 +0100
3ef2ca
***************
3ef2ca
*** 740,741 ****
3ef2ca
--- 740,743 ----
3ef2ca
  {   /* Add new patch number below this line */
3ef2ca
+ /**/
3ef2ca
+     108,
3ef2ca
  /**/
3ef2ca
3ef2ca
-- 
3ef2ca
hundred-and-one symptoms of being an internet addict:
3ef2ca
9. All your daydreaming is preoccupied with getting a faster connection to the
3ef2ca
   net: 28.8...ISDN...cable modem...T1...T3.
3ef2ca
3ef2ca
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
3ef2ca
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
3ef2ca
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
3ef2ca
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///