From f96f4fe61617e5aa51ef30390e3384a6be33de24 Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Fri, 29 Jan 2016 20:43:54 +0000 Subject: [PATCH] Updating position history only when 'positionlog' is set. git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5601 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- ChangeLog | 2 ++ src/files.c | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 60c9fd0e..e3db565b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,8 @@ is set. This fixes a bug unconsciously reported by Mike Frysinger. * src/files.c (do_lockfile): Plug a couple of memory leaks. * src/files.c (update_poshistory): Plug another memory leak. + * src/files.c (close_buffer): Update position history only when + the option 'positionlog' is set. 2016-01-26 Benno Schulenberg * src/files.c (update_poshistory): Do not add directories to the diff --git a/src/files.c b/src/files.c index c6b23394..604c7738 100644 --- a/src/files.c +++ b/src/files.c @@ -588,7 +588,9 @@ bool close_buffer(bool quiet) return FALSE; #ifndef DISABLE_HISTORIES - update_poshistory(openfile->filename, openfile->current->lineno, xplustabs() + 1); + if (ISSET(POS_HISTORY)) + update_poshistory(openfile->filename, + openfile->current->lineno, xplustabs() + 1); #endif /* Switch to the next file buffer. */ -- 2.39.5