commit d7e427daaced1aa5defca416eb344bd4bf4c4a88
parent ee37afd1e229d92bbca725adc8e107ac984e1568
Author: Benno Schulenberg <bensberg@telfort.nl>
Date: Thu, 3 Jul 2025 12:44:49 +0200
tweaks: reshuffle a condition to a better place, like it is elsewhere
Diffstat:
2 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/src/history.c b/src/history.c
@@ -537,10 +537,8 @@ void update_poshistory(void)
poshiststruct *previous = NULL;
poshiststruct *item;
- if (fullpath == NULL || openfile->filename[0] == '\0') {
- free(fullpath);
+ if (fullpath == NULL)
return;
- }
reload_positions_if_needed();
diff --git a/src/nano.c b/src/nano.c
@@ -271,7 +271,7 @@ void close_and_go(void)
delete_lockfile(openfile->lock_filename);
#endif
#ifdef ENABLE_HISTORIES
- if (ISSET(POSITIONLOG))
+ if (ISSET(POSITIONLOG) && openfile->filename[0] != '\0')
update_poshistory();
#endif
#ifdef ENABLE_MULTIBUFFER