]>
Commit | Line | Data |
---|---|---|
6ac11130 AG |
1 | To: vim-dev@vim.org |
2 | Subject: Patch 7.2.325 | |
3 | Fcc: outbox | |
4 | From: Bram Moolenaar <Bram@moolenaar.net> | |
5 | Mime-Version: 1.0 | |
6 | Content-Type: text/plain; charset=UTF-8 | |
7 | Content-Transfer-Encoding: 8bit | |
8 | ------------ | |
9 | ||
10 | Patch 7.2.325 | |
11 | Problem: A stray "w" in the startup vimrc file causes the edited file to be | |
12 | replaced with an empty file. (Stone Kang). | |
13 | Solution: Do not write a buffer when it has never been loaded. | |
14 | Files: src/fileio.c | |
15 | ||
16 | ||
17 | *** ../vim-7.2.324/src/fileio.c 2009-12-02 13:32:10.000000000 +0100 | |
18 | --- src/fileio.c 2009-12-31 14:08:31.000000000 +0100 | |
19 | *************** | |
20 | *** 2981,2986 **** | |
21 | --- 2981,2993 ---- | |
22 | ||
23 | if (fname == NULL || *fname == NUL) /* safety check */ | |
24 | return FAIL; | |
25 | + if (buf->b_ml.ml_mfp == NULL) | |
26 | + { | |
27 | + /* This can happen during startup when there is a stray "w" in the | |
28 | + * vimrc file. */ | |
29 | + EMSG(_(e_emptybuf)); | |
30 | + return FAIL; | |
31 | + } | |
32 | ||
33 | /* | |
34 | * Disallow writing from .exrc and .vimrc in current directory for | |
35 | *** ../vim-7.2.324/src/version.c 2009-12-31 13:18:05.000000000 +0100 | |
36 | --- src/version.c 2009-12-31 14:52:29.000000000 +0100 | |
37 | *************** | |
38 | *** 683,684 **** | |
39 | --- 683,686 ---- | |
40 | { /* Add new patch number below this line */ | |
41 | + /**/ | |
42 | + 325, | |
43 | /**/ | |
44 | ||
45 | -- | |
46 | hundred-and-one symptoms of being an internet addict: | |
47 | 74. Your most erotic dreams are about cybersex | |
48 | ||
49 | /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ | |
50 | /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ | |
51 | \\\ download, build and distribute -- http://www.A-A-P.org /// | |
52 | \\\ help me help AIDS victims -- http://ICCF-Holland.org /// |