summaryrefslogtreecommitdiffstats
path: root/src/ex_cmds.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2006-02-17 21:53:23 +0000
committerBram Moolenaar <Bram@vim.org>2006-02-17 21:53:23 +0000
commit997fb4ba696625e27e17c00d5033b20411aa45a3 (patch)
tree491f6645be05ca184f550a69c4c3b7c7a50b38fe /src/ex_cmds.c
parent49d7bf13e0d7e656ac246ec1dd7309560b070289 (diff)
updated for version 7.0200v7.0200
Diffstat (limited to 'src/ex_cmds.c')
-rw-r--r--src/ex_cmds.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/ex_cmds.c b/src/ex_cmds.c
index dff491a379..c6cdc5a502 100644
--- a/src/ex_cmds.c
+++ b/src/ex_cmds.c
@@ -1811,15 +1811,18 @@ write_viminfo(file, forceit)
/* Use mch_open() to be able to use O_NOFOLLOW and set file
* protection:
- * Unix: same as original file, but strip s-bit.
+ * Unix: same as original file, but strip s-bit. Reset umask to
+ * avoid it getting in the way.
* Others: r&w for user only. */
#ifdef UNIX
+ umask_save = umask(0);
fd = mch_open((char *)tempname,
O_CREAT|O_EXTRA|O_EXCL|O_WRONLY|O_NOFOLLOW,
(int)((st_old.st_mode & 0777) | 0600));
+ (void)umask(umask_save);
#else
fd = mch_open((char *)tempname,
- O_CREAT|O_EXTRA|O_EXCL|O_WRONLY|O_NOFOLLOW, 0600);
+ O_CREAT|O_EXTRA|O_EXCL|O_WRONLY|O_NOFOLLOW, 0600);
#endif
if (fd < 0)
fp_out = NULL;
@@ -3504,8 +3507,11 @@ do_ecmd(fnum, ffname, sfname, eap, newlnum, flags)
/* Tell the diff stuff that this buffer is new and/or needs updating.
* Also needed when re-editing the same buffer, because unloading will
* have removed it as a diff buffer. */
- diff_new_buffer();
- diff_invalidate();
+ if (curwin->w_p_diff)
+ {
+ diff_buf_add(curbuf);
+ diff_invalidate(curbuf);
+ }
#endif
if (command == NULL)