summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2005-11-25 19:58:47 +0000
committerBram Moolenaar <Bram@vim.org>2005-11-25 19:58:47 +0000
commit12625caaa37633e2341828f60be9d612c4b516dd (patch)
tree55452c12eca6d699273e2705beda21d20ce4294c /src
parent1afcace307a11080c4876e6bbaf0fb8073c61bad (diff)
updated for version 7.0159v7.0159
Diffstat (limited to 'src')
-rw-r--r--src/ex_cmds.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/ex_cmds.c b/src/ex_cmds.c
index ac3a2b257c..378fe92b20 100644
--- a/src/ex_cmds.c
+++ b/src/ex_cmds.c
@@ -1697,8 +1697,8 @@ write_viminfo(file, forceit)
*/
st_old.st_dev = st_old.st_ino = 0;
st_old.st_mode = 0600;
- if (mch_stat((char *)fname, &st_old) == 0 && getuid() &&
- !(st_old.st_uid == getuid()
+ if (mch_stat((char *)fname, &st_old) == 0 && getuid()
+ && !(st_old.st_uid == getuid()
? (st_old.st_mode & 0200)
: (st_old.st_gid == getgid()
? (st_old.st_mode & 0020)
@@ -1762,8 +1762,8 @@ write_viminfo(file, forceit)
* link, or file name-length reached. Try again with
* shortname set.
*/
- if (!shortname && st_new.st_dev == st_old.st_dev &&
- st_new.st_ino == st_old.st_ino)
+ if (!shortname && st_new.st_dev == st_old.st_dev
+ && st_new.st_ino == st_old.st_ino)
{
vim_free(tempname);
tempname = NULL;
@@ -1806,7 +1806,12 @@ write_viminfo(file, forceit)
* protection same as original file, but strip s-bit. */
fd = mch_open((char *)tempname,
O_CREAT|O_EXTRA|O_EXCL|O_WRONLY|O_NOFOLLOW,
- (int)((st_old.st_mode & 0777) | 0600));
+#ifdef UNIX
+ (int)((st_old.st_mode & 0777) | 0600)
+#else
+ 0600 /* r&w for user only */
+#endif
+ );
if (fd < 0)
fp_out = NULL;
else