nano

nano with my custom patches
git clone git://bsandro.tech/nano
Log | Files | Refs | README | LICENSE

commit 15738c6b39f5dd1799c82355a2bea5d2e4fa5a89
parent ede44e16ff1408a593b1a7d63dadb25bc81dcaf8
Author: Benno Schulenberg <bensberg@telfort.nl>
Date:   Tue,  3 Oct 2017 21:15:17 +0200

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.

Diffstat:
Msrc/history.c | 27+--------------------------
1 file changed, 1 insertion(+), 26 deletions(-)

diff --git 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,