summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1996-12-11 00:29:18 +0000
committerRichard M. Stallman <rms@gnu.org>1996-12-11 00:29:18 +0000
commit6a3520ad670377763682f04e2707c6495fc6ab5f (patch)
tree98aceb391ab786389f8b234bad391f5c8a00a52d /src
parent5d4fbbf34180d3b098b9974f145d5606ac8b7d2d (diff)
downloademacs-6a3520ad670377763682f04e2707c6495fc6ab5f.tar.gz
(Fwrite_region): Be careful not to destroy contents of
existing file when appending.
Diffstat (limited to 'src')
-rw-r--r--src/fileio.c2
1 files changed, 1 insertions, 1 deletions
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 */
{