From 478e34a80c10a9ee97038d369ac863a19e63cbf4 Mon Sep 17 00:00:00 2001
From: Benno Schulenberg <bensberg@telfort.nl>
Date: Wed, 8 Nov 2017 21:11:57 +0100
Subject: [PATCH] ouch: set the positions-file name also when using the legacy
 state dir

One should test a change before pushing, also when it worked last time.
---
 src/history.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/history.c b/src/history.c
index 6297f40b..ac2f2753 100644
--- a/src/history.c
+++ b/src/history.c
@@ -257,8 +257,10 @@ bool have_statedir(void)
     if (homedir != NULL) {
 	statedir = concatenate(homedir, "/.nano/");
 
-	if (stat(statedir, &dirstat) == 0 && S_ISDIR(dirstat.st_mode))
+	if (stat(statedir, &dirstat) == 0 && S_ISDIR(dirstat.st_mode)) {
+	    poshistname = concatenate(statedir, POSITION_HISTORY);
 	    return TRUE;
+	}
     }
 
     free(statedir);
@@ -289,9 +291,7 @@ bool have_statedir(void)
 	return FALSE;
     }
 
-    if (ISSET(POS_HISTORY))
-	poshistname = concatenate(statedir, POSITION_HISTORY);
-
+    poshistname = concatenate(statedir, POSITION_HISTORY);
     return TRUE;
 }
 
-- 
GitLab