Use ~/.muttrc as the default alias_file if no user muttrc exists.
authorChristoph Berg <cb@df7cb.de>
Thu, 29 Mar 2007 22:23:58 +0000 (15:23 -0700)
committerChristoph Berg <cb@df7cb.de>
Thu, 29 Mar 2007 22:23:58 +0000 (15:23 -0700)
Makes the code agree with the documentation. Document that default is
actually the used muttrc. (Closes Debian #226500.)

init.c
init.h

diff --git a/init.c b/init.c
index 0008ab7f77967b63490021e6b400b1b724a1328c..701303a4bbddcb2aaed2162532916fc1b62be1c1 100644 (file)
--- a/init.c
+++ b/init.c
@@ -2967,7 +2967,9 @@ void mutt_init (int skip_sys_rc, LIST *commands)
       snprintf (buffer, sizeof (buffer), "%s/.mutt/muttrc-%s", NONULL(Homedir), MUTT_VERSION);
     if (access(buffer, F_OK) == -1)
       snprintf (buffer, sizeof (buffer), "%s/.mutt/muttrc", NONULL(Homedir));
-    
+    if (access(buffer, F_OK) == -1) /* default to .muttrc for alias_file */
+      snprintf (buffer, sizeof(buffer), "%s/.muttrc", NONULL(Homedir));
+
     default_rc = 1;
     Muttrc = safe_strdup (buffer);
   }
diff --git a/init.h b/init.h
index 1d8a4eeb682178e4130ff5b29dcfd9e1a6c90998..9124c4d9cca25a1b8b0cbec7501dd29196c779fd 100644 (file)
--- a/init.h
+++ b/init.h
@@ -107,6 +107,9 @@ struct option_t MuttVars[] = {
   ** .pp
   ** \fBNote:\fP Mutt will not automatically source this file; you must
   ** explicitly use the ``$source'' command for it to be executed.
+  ** .pp
+  ** The default for this option is the currently used muttrc file, or
+  ** ``~/.muttrc'' if no user muttrc was found.
   */
   { "alias_format",    DT_STR,  R_NONE, UL &AliasFmt, UL "%4n %2f %t %-10a   %r" },
   /*