From 7d653e5a172632d9b3db9bb71f2cb6350a031674 Mon Sep 17 00:00:00 2001 From: David Lawrence Ramsey Date: Sun, 5 Nov 2017 12:06:03 -0600 Subject: [PATCH] history: fix the check for an existing $HOME/.nano/ directory This fixes https://savannah.gnu.org/bugs/?52339. --- src/history.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/history.c b/src/history.c index d56cc761..5ee5091f 100644 --- a/src/history.c +++ b/src/history.c @@ -253,7 +253,7 @@ 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)) return TRUE; }