mutt stable branch with some hacks

merge stable

+12 -5
+6 -3
configure.ac
··· 588 588 589 589 dnl -- socket dependencies -- 590 590 591 + dnl getaddrinfo is used by getdomain.c, and requires libnsl and 592 + dnl libsocket on some platforms 593 + AC_CHECK_FUNC(gethostent, , AC_CHECK_LIB(nsl, gethostent)) 594 + AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt)) 595 + AC_CHECK_FUNCS(getaddrinfo) 596 + 591 597 AC_ARG_ENABLE(pop, AS_HELP_STRING([--enable-pop],[Enable POP3 support]), 592 598 [ if test x$enableval = xyes ; then 593 599 AC_DEFINE(USE_POP,1,[ Define if you want support for the POP3 protocol. ]) ··· 631 637 AC_MSG_RESULT([no]) 632 638 AC_DEFINE(socklen_t,int, 633 639 [ Define to 'int' if <sys/socket.h> doesn't have it. ])) 634 - AC_CHECK_FUNC(gethostent, , AC_CHECK_LIB(nsl, gethostent)) 635 - AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt)) 636 - AC_CHECK_FUNCS(getaddrinfo) 637 640 AC_DEFINE(USE_SOCKET,1, 638 641 [ Include code for socket support. Set automatically if you enable POP3 or IMAP ]) 639 642 MUTT_LIB_OBJECTS="$MUTT_LIB_OBJECTS account.o mutt_socket.o mutt_tunnel.o"
+6 -2
getdomain.c
··· 31 31 32 32 int getdnsdomainname (char *d, size_t len) 33 33 { 34 - /* A DNS name can actually be only 253 octets, string is 256 */ 34 + int ret = -1; 35 + 36 + #ifdef HAVE_GETADDRINFO 35 37 char *node; 36 38 long node_len; 37 39 struct addrinfo hints; 38 40 struct addrinfo *h; 39 41 char *p; 40 - int ret; 41 42 42 43 *d = '\0'; 43 44 memset(&hints, 0, sizeof (struct addrinfo)); 44 45 hints.ai_flags = AI_CANONNAME; 45 46 hints.ai_family = AF_UNSPEC; 46 47 48 + /* A DNS name can actually be only 253 octets, string is 256 */ 47 49 if ((node_len = sysconf(_SC_HOST_NAME_MAX)) == -1) 48 50 node_len = STRING; 49 51 node = safe_malloc(node_len + 1); ··· 64 66 freeaddrinfo(h); 65 67 } 66 68 FREE (&node); 69 + #endif 70 + 67 71 return ret; 68 72 } 69 73