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>
master
Benno Schulenberg 2018-04-20 10:47:10 +02:00
parent 544d426d86
commit bf8bd02558
1 changed files with 4 additions and 1 deletions

View File

@ -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();