summaryrefslogtreecommitdiff
path: root/src/fileio.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2009-12-31 13:53:33 +0000
committerBram Moolenaar <Bram@vim.org>2009-12-31 13:53:33 +0000
commit70d60e9da1db6d916421b49347ead381e914aaad (patch)
tree950cb57596b8e76e1e5ee3657de5587cad7ab0f9 /src/fileio.c
parent742d1ecd17422afaad75acc016392073c25ef4f6 (diff)
downloadvim-git-70d60e9da1db6d916421b49347ead381e914aaad.tar.gz
updated for version 7.2-325v7.2.325
Diffstat (limited to 'src/fileio.c')
-rw-r--r--src/fileio.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/fileio.c b/src/fileio.c
index f63bb60dc..bdc7439ce 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -2981,6 +2981,13 @@ buf_write(buf, fname, sfname, start, end, eap, append, forceit,
if (fname == NULL || *fname == NUL) /* safety check */
return FAIL;
+ if (buf->b_ml.ml_mfp == NULL)
+ {
+ /* This can happen during startup when there is a stray "w" in the
+ * vimrc file. */
+ EMSG(_(e_emptybuf));
+ return FAIL;
+ }
/*
* Disallow writing from .exrc and .vimrc in current directory for