0
0
mirror of https://github.com/vim/vim.git synced 2025-10-05 05:34:07 -04:00

updated for version 7.0224

This commit is contained in:
Bram Moolenaar
2006-03-14 23:08:30 +00:00
parent 34e9e2f13d
commit 114216c417
2 changed files with 17 additions and 3 deletions

View File

@@ -1811,6 +1811,15 @@ write_viminfo(file, forceit)
if (tempname != NULL) if (tempname != NULL)
{ {
#ifdef VMS
/* fdopen() fails for some reason */
if (fp_out == NULL)
{
umask_save = umask(077);
fp_out = mch_fopen((char *)tempname, WRITEBIN);
(void)umask(umask_save);
}
#else
int fd; int fd;
/* Use mch_open() to be able to use O_NOFOLLOW and set file /* Use mch_open() to be able to use O_NOFOLLOW and set file
@@ -1818,20 +1827,21 @@ write_viminfo(file, forceit)
* Unix: same as original file, but strip s-bit. Reset umask to * Unix: same as original file, but strip s-bit. Reset umask to
* avoid it getting in the way. * avoid it getting in the way.
* Others: r&w for user only. */ * Others: r&w for user only. */
#ifdef UNIX # ifdef UNIX
umask_save = umask(0); umask_save = umask(0);
fd = mch_open((char *)tempname, fd = mch_open((char *)tempname,
O_CREAT|O_EXTRA|O_EXCL|O_WRONLY|O_NOFOLLOW, O_CREAT|O_EXTRA|O_EXCL|O_WRONLY|O_NOFOLLOW,
(int)((st_old.st_mode & 0777) | 0600)); (int)((st_old.st_mode & 0777) | 0600));
(void)umask(umask_save); (void)umask(umask_save);
#else # else
fd = mch_open((char *)tempname, 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 # endif
if (fd < 0) if (fd < 0)
fp_out = NULL; fp_out = NULL;
else else
fp_out = fdopen(fd, WRITEBIN); fp_out = fdopen(fd, WRITEBIN);
#endif /* VMS */
/* /*
* If we can't create in the same directory, try creating a * If we can't create in the same directory, try creating a

View File

@@ -331,6 +331,8 @@ EX(CMD_dsplit, "dsplit", ex_findpat,
BANG|RANGE|DFLALL|WHOLEFOLD|EXTRA), BANG|RANGE|DFLALL|WHOLEFOLD|EXTRA),
EX(CMD_edit, "edit", ex_edit, EX(CMD_edit, "edit", ex_edit,
BANG|FILE1|EDITCMD|ARGOPT|TRLBAR), BANG|FILE1|EDITCMD|ARGOPT|TRLBAR),
EX(CMD_earlier, "earlier", ex_later,
TRLBAR|EXTRA|NOSPC|CMDWIN),
EX(CMD_echo, "echo", ex_echo, EX(CMD_echo, "echo", ex_echo,
EXTRA|NOTRLCOM|SBOXOK|CMDWIN), EXTRA|NOTRLCOM|SBOXOK|CMDWIN),
EX(CMD_echoerr, "echoerr", ex_execute, EX(CMD_echoerr, "echoerr", ex_execute,
@@ -489,6 +491,8 @@ EX(CMD_laddbuffer, "laddbuffer", ex_cbuffer,
RANGE|NOTADR|WORD1|TRLBAR), RANGE|NOTADR|WORD1|TRLBAR),
EX(CMD_laddfile, "laddfile", ex_cfile, EX(CMD_laddfile, "laddfile", ex_cfile,
TRLBAR|FILE1), TRLBAR|FILE1),
EX(CMD_later, "later", ex_later,
TRLBAR|EXTRA|NOSPC|CMDWIN),
EX(CMD_lbuffer, "lbuffer", ex_cbuffer, EX(CMD_lbuffer, "lbuffer", ex_cbuffer,
RANGE|NOTADR|WORD1|TRLBAR), RANGE|NOTADR|WORD1|TRLBAR),
EX(CMD_lcd, "lcd", ex_cd, EX(CMD_lcd, "lcd", ex_cd,