changeset: 6607:f7db9cefd3b0 user: Kevin McCarthy <ke...@8t8.us> date: Tue Apr 05 14:31:36 2016 -0700 link: http://dev.mutt.org/hg/mutt/rev/f7db9cefd3b0
Fix IDNA functions for systems without iconv. The IDNA changes for SMTPUTF8 support introduced a bug for systems without iconv. For those systems, the local<->intl functions would return an error due to the charset conversion failing. Change mutt_idna.c back to being conditionally compiled, but this time based on HAVE_ICONV. If there is no iconv, stub out the functions in mutt_idna.h. changeset: 6608:8251a4d42656 user: Kevin McCarthy <ke...@8t8.us> date: Wed Apr 06 09:58:06 2016 -0700 link: http://dev.mutt.org/hg/mutt/rev/8251a4d42656 merge stable diffs (82 lines): diff -r b983eb6c1a04 -r 8251a4d42656 Makefile.am --- a/Makefile.am Sat Apr 02 13:04:04 2016 -0700 +++ b/Makefile.am Wed Apr 06 09:58:06 2016 -0700 @@ -33,7 +33,7 @@ rfc822.c rfc1524.c rfc2047.c rfc2231.c rfc3676.c \ score.c send.c sendlib.c signal.c sort.c \ status.c system.c thread.c charset.c history.c lib.c \ - muttlib.c editmsg.c mbyte.c mutt_idna.c \ + muttlib.c editmsg.c mbyte.c \ url.c ascii.c crypt-mod.c crypt-mod.h safe_asprintf.c nodist_mutt_SOURCES = $(BUILT_SOURCES) @@ -53,7 +53,7 @@ EXTRA_mutt_SOURCES = account.c bcache.c crypt-gpgme.c crypt-mod-pgp-classic.c \ crypt-mod-pgp-gpgme.c crypt-mod-smime-classic.c \ crypt-mod-smime-gpgme.c dotlock.c gnupgparse.c hcache.c md5.c \ - mutt_sasl.c mutt_socket.c mutt_ssl.c mutt_ssl_gnutls.c \ + mutt_idna.c mutt_sasl.c mutt_socket.c mutt_ssl.c mutt_ssl_gnutls.c \ mutt_tunnel.c pgp.c pgpinvoke.c pgpkey.c pgplib.c pgpmicalg.c \ pgppacket.c pop.c pop_auth.c pop_lib.c remailer.c resize.c sha1.c \ smime.c smtp.c utf8.c wcwidth.c \ diff -r b983eb6c1a04 -r 8251a4d42656 configure.ac --- a/configure.ac Sat Apr 02 13:04:04 2016 -0700 +++ b/configure.ac Wed Apr 06 09:58:06 2016 -0700 @@ -1164,6 +1164,13 @@ dnl -- IDN depends on iconv +dnl mutt_idna.c will perform charset transformations (for smtputf8 +dnl support) as long as at least iconv is installed. If there is no +dnl iconv, then it doesn't need to be included in the build. +if test "$am_cv_func_iconv" = yes; then + MUTT_LIB_OBJECTS="$MUTT_LIB_OBJECTS mutt_idna.o" +fi + AC_ARG_WITH(idn, AS_HELP_STRING([--with-idn=@<:@PFX@:>@],[Use GNU libidn for internationalized domain names]), [ if test "$with_idn" != "no" ; then diff -r b983eb6c1a04 -r 8251a4d42656 mutt_idna.h --- a/mutt_idna.h Sat Apr 02 13:04:04 2016 -0700 +++ b/mutt_idna.h Wed Apr 06 09:58:06 2016 -0700 @@ -45,6 +45,7 @@ #endif /* HAVE_LIBIDN */ +#ifdef HAVE_ICONV int mutt_addrlist_to_intl (ADDRESS *, char **); int mutt_addrlist_to_local (ADDRESS *); @@ -52,6 +53,32 @@ int mutt_env_to_intl (ENVELOPE *, char **, char **); const char *mutt_addr_for_display (ADDRESS *a); +#else +static inline int mutt_addrlist_to_intl (ADDRESS *addr, char **err) +{ + return 0; +} + +static inline int mutt_addrlist_to_local (ADDRESS *addr) +{ + return 0; +} + +static inline void mutt_env_to_local (ENVELOPE *env) +{ + return; +} + +static inline int mutt_env_to_intl (ENVELOPE *env, char **tag, char **err) +{ + return 0; +} + +static inline const char *mutt_addr_for_display (ADDRESS *a) +{ + return a->mailbox; +} +#endif /* HAVE_LIBICONV */ #endif