From ef4296336d3d6770b1fe09ad7b7bdb17a9fd0c68 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Wed, 11 Dec 1996 00:29:18 +0000 Subject: [PATCH] (Fwrite_region): Be careful not to destroy contents of existing file when appending. --- src/fileio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 */ { -- 2.39.5