From: Richard M. Stallman Date: Wed, 11 Dec 1996 00:29:18 +0000 (+0000) Subject: (Fwrite_region): Be careful not to destroy contents of X-Git-Tag: emacs-20.1~3282 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=ef4296336d3d6770b1fe09ad7b7bdb17a9fd0c68;p=emacs.git (Fwrite_region): Be careful not to destroy contents of existing file when appending. --- diff --git a/src/fileio.c b/src/fileio.c index d8c0f263b3e..20419fe394a 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -3536,7 +3536,7 @@ to the file, instead of any buffer contents, and END is ignored.") desc = open (fn, O_WRONLY); #endif /* not DOS_NT */ - if (desc < 0) + if (desc < 0 && (NILP (append) || errno == ENOENT) ) #ifdef VMS if (auto_saving) /* Overwrite any previous version of autosave file */ {