From 2d34586c43a99dc2a683fb68db4e292ed58f6e15 Mon Sep 17 00:00:00 2001 From: Chris Allegretta Date: Sat, 13 Apr 2013 02:56:03 +0000 Subject: [PATCH] * src/files.c (write_file): Don't re-stat() the file if we're writing out a marked file (especially that would give it the wrong stat info). Part 2 of issue reported by Benno Schulenberg. git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4575 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- ChangeLog | 3 +++ src/files.c | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 073e0d3e..d0bcd08b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,9 @@ 2013-04-12 Chris Allegretta * src/files.c (do_insertfile): Check for saved cursor position when inserting a file as well. Fixes Savannah bug 38600 reported by Craig Barnes. + * src/files.c (write_file): Don't re-stat() the file if we're writing out + a marked file (especially that would give it the wrong stat info). Part + 2 of issue reported by Benno Schulenberg. 2013-04-07 Michael Berg * do_cut_text - Fix copying (not cutting) text setting Modified state. Fixes diff --git a/src/files.c b/src/files.c index 613d912c..156e8d57 100644 --- a/src/files.c +++ b/src/files.c @@ -2139,7 +2139,8 @@ bool write_file(const char *name, FILE *f_open, bool tmp, append_type if (openfile->current_stat == NULL) openfile->current_stat = (struct stat *)nmalloc(sizeof(struct stat)); - stat(realname, openfile->current_stat); + if (!openfile->mark_set) + stat(realname, openfile->current_stat); #endif statusbar(P_("Wrote %lu line", "Wrote %lu lines",