Mercurial > vim
comparison src/ex_cmds.c @ 673:513866ffe6af v7.0200
updated for version 7.0200
author | vimboss |
---|---|
date | Fri, 17 Feb 2006 21:53:23 +0000 |
parents | a420bba0d851 |
children | e649c78407e6 |
comparison
equal
deleted
inserted
replaced
672:db58b9066b21 | 673:513866ffe6af |
---|---|
1809 { | 1809 { |
1810 int fd; | 1810 int fd; |
1811 | 1811 |
1812 /* Use mch_open() to be able to use O_NOFOLLOW and set file | 1812 /* Use mch_open() to be able to use O_NOFOLLOW and set file |
1813 * protection: | 1813 * protection: |
1814 * Unix: same as original file, but strip s-bit. | 1814 * Unix: same as original file, but strip s-bit. Reset umask to |
1815 * avoid it getting in the way. | |
1815 * Others: r&w for user only. */ | 1816 * Others: r&w for user only. */ |
1816 #ifdef UNIX | 1817 #ifdef UNIX |
1818 umask_save = umask(0); | |
1817 fd = mch_open((char *)tempname, | 1819 fd = mch_open((char *)tempname, |
1818 O_CREAT|O_EXTRA|O_EXCL|O_WRONLY|O_NOFOLLOW, | 1820 O_CREAT|O_EXTRA|O_EXCL|O_WRONLY|O_NOFOLLOW, |
1819 (int)((st_old.st_mode & 0777) | 0600)); | 1821 (int)((st_old.st_mode & 0777) | 0600)); |
1822 (void)umask(umask_save); | |
1820 #else | 1823 #else |
1821 fd = mch_open((char *)tempname, | 1824 fd = mch_open((char *)tempname, |
1822 O_CREAT|O_EXTRA|O_EXCL|O_WRONLY|O_NOFOLLOW, 0600); | 1825 O_CREAT|O_EXTRA|O_EXCL|O_WRONLY|O_NOFOLLOW, 0600); |
1823 #endif | 1826 #endif |
1824 if (fd < 0) | 1827 if (fd < 0) |
1825 fp_out = NULL; | 1828 fp_out = NULL; |
1826 else | 1829 else |
1827 fp_out = fdopen(fd, WRITEBIN); | 1830 fp_out = fdopen(fd, WRITEBIN); |
3502 | 3505 |
3503 #ifdef FEAT_DIFF | 3506 #ifdef FEAT_DIFF |
3504 /* Tell the diff stuff that this buffer is new and/or needs updating. | 3507 /* Tell the diff stuff that this buffer is new and/or needs updating. |
3505 * Also needed when re-editing the same buffer, because unloading will | 3508 * Also needed when re-editing the same buffer, because unloading will |
3506 * have removed it as a diff buffer. */ | 3509 * have removed it as a diff buffer. */ |
3507 diff_new_buffer(); | 3510 if (curwin->w_p_diff) |
3508 diff_invalidate(); | 3511 { |
3512 diff_buf_add(curbuf); | |
3513 diff_invalidate(curbuf); | |
3514 } | |
3509 #endif | 3515 #endif |
3510 | 3516 |
3511 if (command == NULL) | 3517 if (command == NULL) |
3512 { | 3518 { |
3513 if (newcol >= 0) /* position set by autocommands */ | 3519 if (newcol >= 0) /* position set by autocommands */ |