Patch from upstream. --- nano-1.3.8/src/search.c +++ nano-1.3.8/src/search.c @@ -907,6 +907,8 @@ last_search = mallocstrcpy(last_search, answer); } + last_replace = mallocstrcpy(last_replace, ""); + i = statusq(FALSE, replace_list_2, last_replace, #ifndef NANO_SMALL &replace_history,