Remove the append check we just added :>
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@398 35c25a1d-7b9e-4130-9fde-d3aeb78583b8master
parent
d62614cbc4
commit
f597777323
16
files.c
16
files.c
|
@ -335,17 +335,11 @@ int write_file(char *name, int tmp)
|
||||||
to reflect whether or not to link/unlink/rename the file */
|
to reflect whether or not to link/unlink/rename the file */
|
||||||
else if (ISSET(FOLLOW_SYMLINKS) || !S_ISLNK(lst.st_mode) || tmp) {
|
else if (ISSET(FOLLOW_SYMLINKS) || !S_ISLNK(lst.st_mode) || tmp) {
|
||||||
/* Use O_EXCL if tmp == 1. This is now copied from joe, because
|
/* Use O_EXCL if tmp == 1. This is now copied from joe, because
|
||||||
wiggy says so *shrug*. We also put back the append check,
|
wiggy says so *shrug*. */
|
||||||
which we used to have, forever ago */
|
if (tmp)
|
||||||
if (tmp) {
|
fd = open(realname, O_WRONLY | O_CREAT | O_EXCL, (S_IRUSR|S_IWUSR));
|
||||||
if ((fd = open(realname, (O_WRONLY|O_APPEND|O_NOFOLLOW))) != -1)
|
else
|
||||||
fd = open(realname, O_WRONLY | O_CREAT | O_EXCL,
|
fd = open(realname, O_WRONLY | O_CREAT | O_TRUNC, (S_IRUSR|S_IWUSR));
|
||||||
(S_IRUSR|S_IWUSR));
|
|
||||||
} else {
|
|
||||||
if ((fd = open(realname, (O_WRONLY|O_APPEND))) != -1)
|
|
||||||
fd = open(realname, O_WRONLY | O_CREAT | O_TRUNC,
|
|
||||||
(S_IRUSR|S_IWUSR));
|
|
||||||
}
|
|
||||||
|
|
||||||
/* First, just give up if we couldn't even open the file */
|
/* First, just give up if we couldn't even open the file */
|
||||||
if (fd == -1) {
|
if (fd == -1) {
|
||||||
|
|
Loading…
Reference in New Issue