Karsten Hopp 946f8e
To: vim-dev@vim.org
Karsten Hopp 946f8e
Subject: Patch 7.2.325
Karsten Hopp 946f8e
Fcc: outbox
Karsten Hopp 946f8e
From: Bram Moolenaar <Bram@moolenaar.net>
Karsten Hopp 946f8e
Mime-Version: 1.0
Karsten Hopp 946f8e
Content-Type: text/plain; charset=UTF-8
Karsten Hopp 946f8e
Content-Transfer-Encoding: 8bit
Karsten Hopp 946f8e
------------
Karsten Hopp 946f8e
Karsten Hopp 946f8e
Patch 7.2.325
Karsten Hopp 946f8e
Problem:    A stray "w" in the startup vimrc file causes the edited file to be
Karsten Hopp 946f8e
	    replaced with an empty file. (Stone Kang).
Karsten Hopp 946f8e
Solution:   Do not write a buffer when it has never been loaded.
Karsten Hopp 946f8e
Files:	    src/fileio.c
Karsten Hopp 946f8e
Karsten Hopp 946f8e
Karsten Hopp 946f8e
*** ../vim-7.2.324/src/fileio.c	2009-12-02 13:32:10.000000000 +0100
Karsten Hopp 946f8e
--- src/fileio.c	2009-12-31 14:08:31.000000000 +0100
Karsten Hopp 946f8e
***************
Karsten Hopp 946f8e
*** 2981,2986 ****
Karsten Hopp 946f8e
--- 2981,2993 ----
Karsten Hopp 946f8e
  
Karsten Hopp 946f8e
      if (fname == NULL || *fname == NUL)	/* safety check */
Karsten Hopp 946f8e
  	return FAIL;
Karsten Hopp 946f8e
+     if (buf->b_ml.ml_mfp == NULL)
Karsten Hopp 946f8e
+     {
Karsten Hopp 946f8e
+ 	/* This can happen during startup when there is a stray "w" in the
Karsten Hopp 946f8e
+ 	 * vimrc file. */
Karsten Hopp 946f8e
+ 	EMSG(_(e_emptybuf));
Karsten Hopp 946f8e
+ 	return FAIL;
Karsten Hopp 946f8e
+     }
Karsten Hopp 946f8e
  
Karsten Hopp 946f8e
      /*
Karsten Hopp 946f8e
       * Disallow writing from .exrc and .vimrc in current directory for
Karsten Hopp 946f8e
*** ../vim-7.2.324/src/version.c	2009-12-31 13:18:05.000000000 +0100
Karsten Hopp 946f8e
--- src/version.c	2009-12-31 14:52:29.000000000 +0100
Karsten Hopp 946f8e
***************
Karsten Hopp 946f8e
*** 683,684 ****
Karsten Hopp 946f8e
--- 683,686 ----
Karsten Hopp 946f8e
  {   /* Add new patch number below this line */
Karsten Hopp 946f8e
+ /**/
Karsten Hopp 946f8e
+     325,
Karsten Hopp 946f8e
  /**/
Karsten Hopp 946f8e
Karsten Hopp 946f8e
-- 
Karsten Hopp 946f8e
hundred-and-one symptoms of being an internet addict:
Karsten Hopp 946f8e
74. Your most erotic dreams are about cybersex
Karsten Hopp 946f8e
Karsten Hopp 946f8e
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
Karsten Hopp 946f8e
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
Karsten Hopp 946f8e
\\\        download, build and distribute -- http://www.A-A-P.org        ///
Karsten Hopp 946f8e
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///