~vcs-imports/nano/master

Viewing all changes in revision 8887.

  • Committer: Benno Schulenberg
  • Date: 2020-05-25 10:22:15 UTC
  • Revision ID: git-v1:b30522463ae38015cfbc5c78ad7ae64591c73ac5
files: do not append but truncate when allowing insecure backups

When deleting an existing backup file failed, we do not want to
append to this file, but want instead to overwrite it (when the
user has put 'set allow_insecure_backup' in their nanorc file).

Also, when using O_EXCL (in the normal, secure case), O_APPEND
is pointless, because the file will be created and thus empty.

This fixes https://savannah.gnu.org/bugs/?58439.

Bug existed since version 2.2.5, commit 461519cc.

expand all expand all

Show diffs side-by-side

added added

removed removed

Lines of Context: