X-Git-Url: http://pileus.org/git/?a=blobdiff_plain;f=env.c;h=7d03ae170a463502476d59b13bfae242fbd49a54;hb=ad5ca720795a2f55474a22b63f3a26c2470dd3f2;hp=8293ad5f4195e7636fb016209ee7afada1c4991c;hpb=0fbe10e845265ca868969afcfd867ced865be804;p=~andy%2Ffetchmail diff --git a/env.c b/env.c index 8293ad5f..7d03ae17 100644 --- a/env.c +++ b/env.c @@ -12,24 +12,17 @@ #include #include #include -#ifdef HAVE_NET_SOCKET_H -#include -#endif #include #include #include #include "fetchmail.h" #include "getaddrinfo.h" -#include "i18n.h" -#if defined(HAVE_SETLOCALE) && defined(ENABLE_NLS) && defined(HAVE_STRFTIME) +#include "gettext.h" +#if defined(ENABLE_NLS) #include #endif -#ifndef HAVE_DECL_GETENV -extern char *getenv(const char *); /* needed on sysV68 R3V7.1. */ -#endif - void envquery(int argc, char **argv) /* set up basic stuff from the environment (including the rc file name) */ { @@ -222,7 +215,6 @@ char *rfc822timestamp(void) static char buf[50]; time(&now); -#ifdef HAVE_STRFTIME /* * Conform to RFC822. We generate a 4-digit year here, avoiding * Y2K hassles. Max length of this timestamp in an English locale @@ -231,25 +223,15 @@ char *rfc822timestamp(void) * weird multibyte i18n characters (such as kanji) from showing up * in your Received headers. */ -#if defined(HAVE_SETLOCALE) && defined(ENABLE_NLS) +#if defined(ENABLE_NLS) setlocale (LC_TIME, "C"); #endif strftime(buf, sizeof(buf)-1, "%a, %d %b %Y %H:%M:%S XXXXX (%Z)", localtime(&now)); -#if defined(HAVE_SETLOCALE) && defined(ENABLE_NLS) +#if defined(ENABLE_NLS) setlocale (LC_TIME, ""); #endif strncpy(strstr(buf, "XXXXX"), tzoffset(&now), 5); -#else - /* - * This is really just a portability fallback, as the - * date format ctime(3) emits is not RFC822 - * conformant. - */ - strlcpy(buf, ctime(&now), sizeof(buf)); - buf[strlen(buf)-1] = '\0'; /* remove trailing \n */ -#endif /* HAVE_STRFTIME */ - return(buf); } @@ -261,8 +243,6 @@ const char *showproto(int proto) case P_AUTO: return("auto"); #ifdef POP3_ENABLE case P_POP3: return("POP3"); - case P_APOP: return("APOP"); - case P_RPOP: return("RPOP"); #endif /* POP3_ENABLE */ #ifdef IMAP_ENABLE case P_IMAP: return("IMAP");