From bf8bd02558bd5f10ff12e00917d6d41f2d3f2a18 Mon Sep 17 00:00:00 2001
From: Benno Schulenberg <bensberg@telfort.nl>
Date: Fri, 20 Apr 2018 10:47:10 +0200
Subject: [PATCH] build: do not prefix an alternative rcfilename with a dot

When the user configures nano with --enable-altrcname=name,
the specified name should not be prefixed with a dot.

This fixes https://savannah.gnu.org/bugs/?53694.
Reported-by: Cody A. Taylor <codemister99@yahoo.com>
---
 src/rcfile.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/rcfile.c b/src/rcfile.c
index eb4e2c6f..afa172ec 100644
--- a/src/rcfile.c
+++ b/src/rcfile.c
@@ -31,7 +31,10 @@
 #ifdef ENABLE_NANORC
 
 #ifndef RCFILE_NAME
+#define HOME_RC_NAME ".nanorc"
 #define RCFILE_NAME "nanorc"
+#else
+#define HOME_RC_NAME RCFILE_NAME
 #endif
 
 static const rcoption rcopts[] = {
@@ -1252,7 +1255,7 @@ void do_rcfiles(void)
 
 	/* Now try the to find a nanorc file in the user's home directory
 	 * or in the XDG configuration directories. */
-	if (have_nanorc(homedir, "/." RCFILE_NAME))
+	if (have_nanorc(homedir, "/" HOME_RC_NAME))
 		parse_one_nanorc();
 	else if (have_nanorc(xdgconfdir, "/nano/" RCFILE_NAME))
 		parse_one_nanorc();
-- 
GitLab