diff -Nur mutt-1.4.1.orig/configure.in mutt-1.4.1/configure.in --- mutt-1.4.1.orig/configure.in Mon Dec 8 13:51:51 2003 +++ mutt-1.4.1/configure.in Mon Dec 8 14:01:22 2003 @@ -592,6 +592,31 @@ ]) AM_CONDITIONAL(USE_SASL, test x$need_sasl = xyes) +AC_ARG_WITH(home-etc, [ --with-home-etc[=PFX] Use HOME-ETC library to allow user keeping it's configuration files in a non-standard place ], + [ + if test "$with_home_etc" != "no" + then + if test "$with_home_etc" != "yes" + then + LDFLAGS="$LDFLAGS -L$with_home_etc/lib" + fi + + saved_LIBS="$LIBS" + + AC_CHECK_LIB(home_etc, get_home_etc_static,, + AC_MSG_ERROR([could not find libhome_etc]),) + + AC_CHECK_HEADERS(home_etc.h) + + MUTTLIBS="$MUTTLIBS -lhome_etc" + LIBS="$saved_LIBS" + AC_DEFINE(USE_HOME_ETC,1, + [ Define if want to use the HOME-ETC library. ]) + need_home_etc=yes + fi + ]) +AM_CONDITIONAL(USE_HOME_ETC, test x$need_home_etc = xyes) + if test "$need_md5" = "yes" then MUTT_LIB_OBJECTS="$MUTT_LIB_OBJECTS md5c.o" diff -Nur mutt-1.4.1.orig/doc/mutt.man mutt-1.4.1/doc/mutt.man --- mutt-1.4.1.orig/doc/mutt.man Wed Jul 24 10:41:31 2002 +++ mutt-1.4.1/doc/mutt.man Mon Dec 8 13:53:17 2003 @@ -122,13 +122,13 @@ Specifies the editor to use when composing messages. .SH FILES .PP -.IP "~/.muttrc or ~/.mutt/muttrc" +.IP "$HOME_ETC/.muttrc" or "$HOME_ETC/.mutt/muttrc" or "~/.muttrc" or "~/.mutt/muttrc" User configuration file. .IP "/etc/Muttrc" System-wide configuration file. .IP "/tmp/muttXXXXXX" Temporary files created by Mutt. -.IP "~/.mailcap" +.IP "$HOME_ETC/.mailcap" or "~/.mailcap" User definition for handling non-text MIME types. .IP "/etc/mailcap" System definition for handling non-text MIME types. diff -Nur mutt-1.4.1.orig/init.c mutt-1.4.1/init.c --- mutt-1.4.1.orig/init.c Mon Dec 8 13:51:51 2003 +++ mutt-1.4.1/init.c Mon Dec 8 14:02:19 2003 @@ -25,6 +25,12 @@ #include "mbyte.h" #include "charset.h" +#ifdef HAVE_HOME_ETC_H +# include +# define H_CFDIR _HEdir +#else +# define H_CFDIR Homedir +#endif #ifdef HAVE_PGP #include "pgp.h" @@ -1892,13 +1898,13 @@ if (!Muttrc) { - snprintf (buffer, sizeof(buffer), "%s/.muttrc-%s", NONULL(Homedir), MUTT_VERSION); + snprintf (buffer, sizeof(buffer), "%s/.muttrc-%s", NONULL(H_CFDIR), MUTT_VERSION); if (access(buffer, F_OK) == -1) - snprintf (buffer, sizeof(buffer), "%s/.muttrc", NONULL(Homedir)); + snprintf (buffer, sizeof(buffer), "%s/.muttrc", NONULL(H_CFDIR)); if (access(buffer, F_OK) == -1) - snprintf (buffer, sizeof (buffer), "%s/.mutt/muttrc-%s", NONULL(Homedir), MUTT_VERSION); + snprintf (buffer, sizeof (buffer), "%s/.mutt/muttrc-%s", NONULL(H_CFDIR), MUTT_VERSION); if (access(buffer, F_OK) == -1) - snprintf (buffer, sizeof (buffer), "%s/.mutt/muttrc", NONULL(Homedir)); + snprintf (buffer, sizeof (buffer), "%s/.mutt/muttrc", NONULL(H_CFDIR)); default_rc = 1; Muttrc = safe_strdup (buffer); diff -Nur mutt-1.4.1.orig/muttbug.sh.in mutt-1.4.1/muttbug.sh.in --- mutt-1.4.1.orig/muttbug.sh.in Mon Dec 8 13:51:50 2003 +++ mutt-1.4.1/muttbug.sh.in Mon Dec 8 13:53:17 2003 @@ -244,13 +244,21 @@ if test "$personal" = "yes" ; then CANDIDATES=".muttrc-${MUTTVERSION} .muttrc .mutt/muttrc-${MUTTVERSION} .mutt/muttrc" MATCHED="none" + if test -n "$HOME_ETC" ; then + for f in $CANDIDATES; do + if test -f "${HOME_ETC}/$f" ; then + MATCHED="${HOME_ETC}/$f" + break + fi + done + else for f in $CANDIDATES; do if test -f "${HOME}/$f" ; then MATCHED="${HOME}/$f" break fi done - + fi if test "$MATCHED" = "none" ; then echo "Warning: Can't find your personal .muttrc." >&2 else diff -Nur mutt-1.4.1.orig/sendlib.c mutt-1.4.1/sendlib.c --- mutt-1.4.1.orig/sendlib.c Mon Dec 8 13:51:51 2003 +++ mutt-1.4.1/sendlib.c Mon Dec 8 14:02:54 2003 @@ -29,7 +29,6 @@ #include "pager.h" #include "charset.h" - #include #include #include @@ -40,6 +39,13 @@ #include #include +#ifdef HAVE_HOME_ETC_H +# include +# define H_CFDIR _HEdir +#else +# define H_CFDIR Homedir +#endif + #ifdef HAVE_SYSEXITS_H #include #else /* Make sure EX_OK is defined */ @@ -958,9 +964,9 @@ /* Given a file with path ``s'', see if there is a registered MIME type. * returns the major MIME type, and copies the subtype to ``d''. First look - * for ~/.mime.types, then look in a system mime.types if we can find one. - * The longest match is used so that we can match `ps.gz' when `gz' also - * exists. + * for either $HOME_ETC/.mime.types or ~/.mime.types, then look in a system + * mime.types if we can find one. The longest match is used so that we can + * match `ps.gz' when `gz' also exists. */ static int lookup_mime_type (BODY *att, const char *path) @@ -989,7 +995,7 @@ switch (count) { case 0: - snprintf (buf, sizeof (buf), "%s/.mime.types", NONULL(Homedir)); + snprintf (buf, sizeof (buf), "%s/.mime.types", NONULL(H_CFDIR)); break; case 1: strfcpy (buf, SYSCONFDIR"/mime.types", sizeof(buf));