1 diff -Nur mutt-1.4.1.orig/configure.in mutt-1.4.1/configure.in
2 --- mutt-1.4.1.orig/configure.in Mon Dec 8 13:51:51 2003
3 +++ mutt-1.4.1/configure.in Mon Dec 8 14:01:22 2003
6 AM_CONDITIONAL(USE_SASL, test x$need_sasl = xyes)
8 +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 ],
10 + if test "$with_home_etc" != "no"
12 + if test "$with_home_etc" != "yes"
14 + LDFLAGS="$LDFLAGS -L$with_home_etc/lib"
19 + AC_CHECK_LIB(home_etc, get_home_etc_static,,
20 + AC_MSG_ERROR([could not find libhome_etc]),)
22 + AC_CHECK_HEADERS(home_etc.h)
24 + MUTTLIBS="$MUTTLIBS -lhome_etc"
26 + AC_DEFINE(USE_HOME_ETC,1,
27 + [ Define if want to use the HOME-ETC library. ])
31 +AM_CONDITIONAL(USE_HOME_ETC, test x$need_home_etc = xyes)
33 if test "$need_md5" = "yes"
35 MUTT_LIB_OBJECTS="$MUTT_LIB_OBJECTS md5c.o"
36 diff -Nur mutt-1.4.1.orig/doc/mutt.man mutt-1.4.1/doc/mutt.man
37 --- mutt-1.4.1.orig/doc/mutt.man Wed Jul 24 10:41:31 2002
38 +++ mutt-1.4.1/doc/mutt.man Mon Dec 8 13:53:17 2003
40 Specifies the editor to use when composing messages.
43 -.IP "~/.muttrc or ~/.mutt/muttrc"
44 +.IP "$HOME_ETC/.muttrc" or "$HOME_ETC/.mutt/muttrc" or "~/.muttrc" or "~/.mutt/muttrc"
45 User configuration file.
47 System-wide configuration file.
49 Temporary files created by Mutt.
51 +.IP "$HOME_ETC/.mailcap" or "~/.mailcap"
52 User definition for handling non-text MIME types.
54 System definition for handling non-text MIME types.
55 diff -Nur mutt-1.4.1.orig/init.c mutt-1.4.1/init.c
56 --- mutt-1.4.1.orig/init.c Mon Dec 8 13:51:51 2003
57 +++ mutt-1.4.1/init.c Mon Dec 8 14:02:19 2003
62 +#ifdef HAVE_HOME_ETC_H
63 +# include <home_etc.h>
64 +# define H_CFDIR _HEdir
66 +# define H_CFDIR Homedir
71 @@ -1892,13 +1898,13 @@
75 - snprintf (buffer, sizeof(buffer), "%s/.muttrc-%s", NONULL(Homedir), MUTT_VERSION);
76 + snprintf (buffer, sizeof(buffer), "%s/.muttrc-%s", NONULL(H_CFDIR), MUTT_VERSION);
77 if (access(buffer, F_OK) == -1)
78 - snprintf (buffer, sizeof(buffer), "%s/.muttrc", NONULL(Homedir));
79 + snprintf (buffer, sizeof(buffer), "%s/.muttrc", NONULL(H_CFDIR));
80 if (access(buffer, F_OK) == -1)
81 - snprintf (buffer, sizeof (buffer), "%s/.mutt/muttrc-%s", NONULL(Homedir), MUTT_VERSION);
82 + snprintf (buffer, sizeof (buffer), "%s/.mutt/muttrc-%s", NONULL(H_CFDIR), MUTT_VERSION);
83 if (access(buffer, F_OK) == -1)
84 - snprintf (buffer, sizeof (buffer), "%s/.mutt/muttrc", NONULL(Homedir));
85 + snprintf (buffer, sizeof (buffer), "%s/.mutt/muttrc", NONULL(H_CFDIR));
88 Muttrc = safe_strdup (buffer);
89 diff -Nur mutt-1.4.1.orig/muttbug.sh.in mutt-1.4.1/muttbug.sh.in
90 --- mutt-1.4.1.orig/muttbug.sh.in Mon Dec 8 13:51:50 2003
91 +++ mutt-1.4.1/muttbug.sh.in Mon Dec 8 13:53:17 2003
93 if test "$personal" = "yes" ; then
94 CANDIDATES=".muttrc-${MUTTVERSION} .muttrc .mutt/muttrc-${MUTTVERSION} .mutt/muttrc"
96 + if test -n "$HOME_ETC" ; then
97 + for f in $CANDIDATES; do
98 + if test -f "${HOME_ETC}/$f" ; then
99 + MATCHED="${HOME_ETC}/$f"
104 for f in $CANDIDATES; do
105 if test -f "${HOME}/$f" ; then
112 if test "$MATCHED" = "none" ; then
113 echo "Warning: Can't find your personal .muttrc." >&2
115 diff -Nur mutt-1.4.1.orig/sendlib.c mutt-1.4.1/sendlib.c
116 --- mutt-1.4.1.orig/sendlib.c Mon Dec 8 13:51:51 2003
117 +++ mutt-1.4.1/sendlib.c Mon Dec 8 14:02:54 2003
127 #include <sys/wait.h>
130 +#ifdef HAVE_HOME_ETC_H
131 +# include <home_etc.h>
132 +# define H_CFDIR _HEdir
134 +# define H_CFDIR Homedir
137 #ifdef HAVE_SYSEXITS_H
138 #include <sysexits.h>
139 #else /* Make sure EX_OK is defined <philiph@pobox.com> */
142 /* Given a file with path ``s'', see if there is a registered MIME type.
143 * returns the major MIME type, and copies the subtype to ``d''. First look
144 - * for ~/.mime.types, then look in a system mime.types if we can find one.
145 - * The longest match is used so that we can match `ps.gz' when `gz' also
147 + * for either $HOME_ETC/.mime.types or ~/.mime.types, then look in a system
148 + * mime.types if we can find one. The longest match is used so that we can
149 + * match `ps.gz' when `gz' also exists.
152 static int lookup_mime_type (BODY *att, const char *path)
157 - snprintf (buf, sizeof (buf), "%s/.mime.types", NONULL(Homedir));
158 + snprintf (buf, sizeof (buf), "%s/.mime.types", NONULL(H_CFDIR));
161 strfcpy (buf, SYSCONFDIR"/mime.types", sizeof(buf));