From e3df8788b71b25a78b97ed4284d435c976b31ac4 Mon Sep 17 00:00:00 2001
From: David Lawrence Ramsey <pooka109@gmail.com>
Date: Sat, 2 Jul 2005 17:49:27 +0000
Subject: [PATCH] in do_replace(), blank out last_replace properly again just
 before displaying the "Replace" prompt

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2808 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
---
 ChangeLog    | 4 ++++
 src/search.c | 2 ++
 2 files changed, 6 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index 3720668f..e7bfc4af 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -12,6 +12,10 @@ CVS code -
 	- When constant cursor position display is on, only display the
 	  cursor position if there are no keys waiting in the buffer.
 	  (DLR)
+- search.c:
+  do_replace()
+	- Blank out last_replace properly again just before displaying
+	  the "Replace" prompt. (DLR, found by Mike Frysinger)
 
 GNU nano 1.3.8 - 2005.06.30
 - General:
diff --git a/src/search.c b/src/search.c
index c1975a61..6687975d 100644
--- a/src/search.c
+++ b/src/search.c
@@ -907,6 +907,8 @@ void do_replace(void)
 	last_search = mallocstrcpy(last_search, answer);
     }
 
+    last_replace = mallocstrcpy(last_replace, "");
+
     i = statusq(FALSE, replace_list_2, last_replace,
 #ifndef NANO_SMALL
 	&replace_history,
-- 
GitLab