From: Chris Allegretta <chrisa@asty.org>
Date: Sat, 14 Nov 2009 20:06:24 +0000 (+0000)
Subject:         * files.c (do_writeout) - Only mention file modification if we're writing... 
X-Git-Tag: v2.1.99pre1~1
X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=533b9fa8272efa6a8f5b02738d05dc01683d985e;p=nano.git

    * files.c (do_writeout) - Only mention file modification if we're writing the same
          file we originally opened.



git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4424 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
---

diff --git a/ChangeLog b/ChangeLog
index 276cfa4c..e18aad91 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,8 @@
 2009-11-14 Chris Allegretta <chrisa@asty.org>
 	* move.c (do_first_line, do_last_line): Just set edit_refresh_needed rather than 
 	  get messy.
+	* files.c (do_writeout) - Only mention file modification if we're writing the same
+	  file we originally opened.
 
 2009-11-13 Chris Allegretta <chrisa@asty.org>
 	* winio.c: Add new static maxsize to be able to easier calculation with
diff --git a/src/files.c b/src/files.c
index bfa2ca34..7484e9cb 100644
--- a/src/files.c
+++ b/src/files.c
@@ -2118,7 +2118,7 @@ bool do_writeout(bool exiting)
 		    }
 		}
 #ifndef NANO_TINY
-		if (openfile->current_stat && openfile->current_stat->st_mtime < st.st_mtime) {
+		if (name_exists && openfile->current_stat && openfile->current_stat->st_mtime < st.st_mtime) {
 		    i = do_yesno_prompt(FALSE,
 			_("File was modified since you opened it, continue saving ? "));
 		    if (i == 0 || i == -1)