073263
To: vim_dev@googlegroups.com
073263
Subject: Patch 7.4.364
073263
Fcc: outbox
073263
From: Bram Moolenaar <Bram@moolenaar.net>
073263
Mime-Version: 1.0
073263
Content-Type: text/plain; charset=UTF-8
073263
Content-Transfer-Encoding: 8bit
073263
------------
073263
073263
Patch 7.4.364
073263
Problem:    When the viminfo file can't be renamed there is no error message.
073263
	    (Vladimir Berezhnoy)
073263
Solution:   Check for the rename to fail.
073263
Files:	    src/ex_cmds.c
073263
073263
073263
*** ../vim-7.4.363/src/ex_cmds.c	2014-05-22 14:00:12.694534712 +0200
073263
--- src/ex_cmds.c	2014-07-09 21:11:44.531557830 +0200
073263
***************
073263
*** 2004,2014 ****
073263
      {
073263
  	fclose(fp_in);
073263
  
073263
! 	/*
073263
! 	 * In case of an error keep the original viminfo file.
073263
! 	 * Otherwise rename the newly written file.
073263
! 	 */
073263
! 	if (viminfo_errcnt || vim_rename(tempname, fname) == -1)
073263
  	    mch_remove(tempname);
073263
  
073263
  #ifdef WIN3264
073263
--- 2004,2017 ----
073263
      {
073263
  	fclose(fp_in);
073263
  
073263
! 	/* In case of an error keep the original viminfo file.  Otherwise
073263
! 	 * rename the newly written file.  Give an error if that fails. */
073263
! 	if (viminfo_errcnt == 0 && vim_rename(tempname, fname) == -1)
073263
! 	{
073263
! 	    ++viminfo_errcnt;
073263
! 	    EMSG2(_("E886: Can't rename viminfo file to %s!"), fname);
073263
! 	}
073263
! 	if (viminfo_errcnt > 0)
073263
  	    mch_remove(tempname);
073263
  
073263
  #ifdef WIN3264
073263
*** ../vim-7.4.363/src/version.c	2014-07-09 20:51:04.519583033 +0200
073263
--- src/version.c	2014-07-09 21:13:18.575555919 +0200
073263
***************
073263
*** 736,737 ****
073263
--- 736,739 ----
073263
  {   /* Add new patch number below this line */
073263
+ /**/
073263
+     364,
073263
  /**/
073263
073263
-- 
073263
MONK: ... and the Lord spake, saying, "First shalt thou take out the Holy Pin,
073263
      then shalt thou count to three, no more, no less.  Three shalt be the
073263
      number thou shalt count, and the number of the counting shalt be three.
073263
      Four shalt thou not count, neither count thou two, excepting that thou
073263
      then proceed to three.  Five is right out.  Once the number three, being
073263
      the third number, be reached, then lobbest thou thy Holy Hand Grenade of
073263
      Antioch towards thou foe, who being naughty in my sight, shall snuff it.
073263
                 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
073263
073263
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
073263
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
073263
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
073263
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///