history: slate the search-history migration for removal

This commit is contained in:
Benno Schulenberg
2016-09-03 21:02:26 +02:00
parent ed9e5d7183
commit f13707fd1d
2 changed files with 7 additions and 6 deletions

View File

@@ -2940,8 +2940,8 @@ char *histfilename(void)
return construct_filename("/.nano/search_history");
}
/* Construct the legacy history filename.
* (Deprecate in 2.5, delete later.) */
/* Construct the legacy history filename. */
/* (To be removed in 2018.) */
char *legacyhistfilename(void)
{
return construct_filename("/.nano_history");
@@ -3001,6 +3001,8 @@ void load_history(void)
char *legacyhist = legacyhistfilename();
struct stat hstat;
/* If there is an old history file, migrate it. */
/* (To be removed in 2018.) */
if (stat(legacyhist, &hstat) != -1 && stat(nanohist, &hstat) == -1) {
if (rename(legacyhist, nanohist) == -1)
history_error(N_("Detected a legacy nano history file (%s) which I tried to move\n"