From 15738c6b39f5dd1799c82355a2bea5d2e4fa5a89 Mon Sep 17 00:00:00 2001
From: Benno Schulenberg <bensberg@telfort.nl>
Date: Tue, 3 Oct 2017 21:15:17 +0200
Subject: [PATCH] history: remove the migration service for the old searches
 file

The code has been there for the last thirty releases -- for six
whole years -- more than enough time to have served its purpose.
---
 src/history.c | 27 +--------------------------
 1 file changed, 1 insertion(+), 26 deletions(-)

diff --git a/src/history.c b/src/history.c
index 3abdca61..11cf6c20 100644
--- a/src/history.c
+++ b/src/history.c
@@ -234,13 +234,6 @@ char *histfilename(void)
     return construct_filename("/.nano/search_history");
 }
 
-/* Construct the legacy history filename. */
-/* (To be removed in 2018.) */
-char *legacyhistfilename(void)
-{
-    return construct_filename("/.nano_history");
-}
-
 char *poshistfilename(void)
 {
     return construct_filename("/.nano/filepos_history");
@@ -291,24 +284,7 @@ bool have_dotnano(void)
 void load_history(void)
 {
     char *histname = histfilename();
-    char *legacyhist = legacyhistfilename();
-    struct stat hstat;
-    FILE *hisfile;
-
-    /* If there is an old history file, migrate it. */
-    /* (To be removed in 2018.) */
-    if (stat(legacyhist, &hstat) != -1 && stat(histname, &hstat) == -1) {
-	if (rename(legacyhist, histname) == -1)
-	    history_error(N_("Detected a legacy nano history file (%s) which I tried to move\n"
-			     "to the preferred location (%s) but encountered an error: %s"),
-				legacyhist, histname, strerror(errno));
-	else
-	    history_error(N_("Detected a legacy nano history file (%s) which I moved\n"
-			     "to the preferred location (%s)\n(see the nano FAQ about this change)"),
-				legacyhist, histname);
-    }
-
-    hisfile = fopen(histname, "rb");
+    FILE *hisfile = fopen(histname, "rb");
 
     if (hisfile == NULL) {
 	if (errno != ENOENT) {
@@ -347,7 +323,6 @@ void load_history(void)
     history_changed = FALSE;
 
     free(histname);
-    free(legacyhist);
 }
 
 /* Write the lines of a history list, starting at head, from oldest to newest,
-- 
GitLab