From f997801a16ce4a8530cb30cddebfe6243cb3502d Mon Sep 17 00:00:00 2001 From: pdmef Date: Wed, 18 May 2005 18:33:00 +0000 Subject: [PATCH] Rocco Rutte: enough is enough: remove exact address as just way too broken git-svn-id: svn://svn.berlios.de/mutt-ng/trunk@297 e385b8ad-14ed-0310-8656-cc95a2468c6d --- INSTALL | 8 -------- alias.c | 4 ---- configure.in | 8 -------- hcache.c | 12 ------------ init.h | 2 -- main.c | 5 ----- query.c | 5 ----- rfc2047.c | 8 -------- rfc822.c | 44 -------------------------------------------- rfc822.h | 3 --- 10 files changed, 99 deletions(-) diff --git a/INSTALL b/INSTALL index be04a07..df858de 100644 --- a/INSTALL +++ b/INSTALL @@ -181,14 +181,6 @@ to ``configure'' to help it out, or change the default behavior: so a short note on this topic can be added to the Platform notes section below.) ---enable-exact-address - By default, Mutt-ng will rewrite all addresses in the form - Personal Name - regardless of the input. By enabling this option, Mutt-ng will write - addresses in the same form they are parsed. NOTE: this requires - significantly more memory. - - Once ``configure'' has completed, simply type ``make install.'' Mutt-ng should compile cleanly (without errors) and you should end up with a diff --git a/alias.c b/alias.c index d28427a..cfcd456 100644 --- a/alias.c +++ b/alias.c @@ -84,10 +84,6 @@ static ADDRESS *mutt_expand_aliases_r (ADDRESS * a, LIST ** expn) mutt_gecos_name (namebuf, sizeof (namebuf), pw); str_replace (&a->personal, namebuf); - -#ifdef EXACT_ADDRESS - FREE (&a->val); -#endif } } } diff --git a/configure.in b/configure.in index 84fceb3..68aadba 100644 --- a/configure.in +++ b/configure.in @@ -808,14 +808,6 @@ AC_ARG_WITH(exec-shell, AC_HELP_STRING([--with-exec-shell=SHELL], [Specify alter fi], [AC_DEFINE_UNQUOTED(EXECSHELL, "/bin/sh")]) -AC_ARG_ENABLE(exact-address, AC_HELP_STRING([--enable-exact-address], [Enable regeneration of email addresses]), - [if test $enableval = yes; then - AC_DEFINE(EXACT_ADDRESS,1, - [Enable exact regeneration of email addresses as parsed? - NOTE: this requires significant more memory when defined.]) - - fi]) - dnl -- start cache -- AC_ARG_ENABLE(hcache, AC_HELP_STRING([--enable-hcache], [Enable header caching]), [if test x$enableval = xyes; then diff --git a/hcache.c b/hcache.c index 7e7334d..6db60e9 100644 --- a/hcache.c +++ b/hcache.c @@ -177,9 +177,6 @@ static unsigned char *dump_address (ADDRESS * a, unsigned char *d, int *off) d = dump_int (0xdeadbeef, d, off); while (a) { -#ifdef EXACT_ADDRESS - d = dump_char (a->val, d, off); -#endif d = dump_char (a->personal, d, off); d = dump_char (a->mailbox, d, off); d = dump_int (a->group, d, off); @@ -200,9 +197,6 @@ static void restore_address (ADDRESS ** a, const unsigned char *d, int *off) while (counter) { *a = safe_malloc (sizeof (ADDRESS)); -#ifdef EXACT_ADDRESS - restore_char (&(*a)->val, d, off); -#endif restore_char (&(*a)->personal, d, off); restore_char (&(*a)->mailbox, d, off); restore_int ((unsigned int *) &(*a)->group, d, off); @@ -463,12 +457,6 @@ static int generate_crc32 () safe_strlen ("HAVE_LANGINFO_CODESET")); #endif -#if EXACT_ADDRESS - crc = - crc32 (crc, (unsigned char const *) "EXACT_ADDRESS", - safe_strlen ("EXACT_ADDRESS")); -#endif - #ifdef USE_POP crc = crc32 (crc, (unsigned char const *) "USE_POP", safe_strlen ("USE_POP")); diff --git a/init.h b/init.h index 8f72989..a12d82d 100644 --- a/init.h +++ b/init.h @@ -2788,7 +2788,6 @@ struct option_t MuttVars[] = { ** .pp ** If set, all folders are opened in read-only mode. */ -#ifndef EXACT_ADDRESS {"realname", DT_STR, R_BOTH, UL &Realname, 0}, /* ** .pp @@ -2801,7 +2800,6 @@ struct option_t MuttVars[] = { ** variable will \fInot\fP be used when the user has set a real name ** in the $$from variable. */ -#endif {"recall", DT_QUAD, R_NONE, OPT_RECALL, M_ASKYES}, /* ** .pp diff --git a/main.c b/main.c index ce8c1be..8342918 100644 --- a/main.c +++ b/main.c @@ -356,11 +356,6 @@ static void show_version (void) #else "-BUFFY_SIZE " #endif -#ifdef EXACT_ADDRESS - "+EXACT_ADDRESS " -#else - "-EXACT_ADDRESS " -#endif #ifdef SUN_ATTACHMENT "+SUN_ATTACHMENT " #else diff --git a/query.c b/query.c index 570ef07..5c5d0a3 100644 --- a/query.c +++ b/query.c @@ -156,11 +156,6 @@ static int query_search (MUTTMENU * m, regex_t * re, int n) if (table[n].data->addr->mailbox && !regexec (re, table[n].data->addr->mailbox, 0, NULL, 0)) return 0; -#ifdef EXACT_ADDRESS - if (table[n].data->addr->val && - !regexec (re, table[n].data->addr->val, 0, NULL, 0)) - return 0; -#endif } return REG_NOMATCH; diff --git a/rfc2047.c b/rfc2047.c index 596b327..209330e 100644 --- a/rfc2047.c +++ b/rfc2047.c @@ -543,10 +543,6 @@ void rfc2047_encode_adrlist (ADDRESS * addr, const char *tag) while (ptr) { if (ptr->personal) _rfc2047_encode_string (&ptr->personal, 1, col); -#ifdef EXACT_ADDRESS - if (ptr->val) - _rfc2047_encode_string (&ptr->val, 1, col); -#endif ptr = ptr->next; } } @@ -801,10 +797,6 @@ void rfc2047_decode_adrlist (ADDRESS * a) while (a) { if (a->personal) rfc2047_decode (&a->personal); -#ifdef EXACT_ADDRESS - if (a->val && strstr (a->val, "=?") != NULL) - rfc2047_decode (&a->val); -#endif a = a->next; } } diff --git a/rfc822.c b/rfc822.c index d3b5d56..64b1606 100644 --- a/rfc822.c +++ b/rfc822.c @@ -70,9 +70,6 @@ void rfc822_free_address (ADDRESS ** p) while (*p) { t = *p; *p = (*p)->next; -#ifdef EXACT_ADDRESS - FREE (&t->val); -#endif FREE (&t->personal); FREE (&t->mailbox); FREE (&t); @@ -328,10 +325,6 @@ ADDRESS *rfc822_parse_adrlist (ADDRESS * top, const char *s) last->personal = safe_strdup (comment); } -#ifdef EXACT_ADDRESS - if (last && !last->val) - last->val = str_substrdup (begin, s); -#endif commentlen = 0; phraselen = 0; s++; @@ -361,10 +354,6 @@ ADDRESS *rfc822_parse_adrlist (ADDRESS * top, const char *s) top = cur; last = cur; -#ifdef EXACT_ADDRESS - last->val = str_substrdup (begin, s); -#endif - phraselen = 0; commentlen = 0; s++; @@ -381,10 +370,6 @@ ADDRESS *rfc822_parse_adrlist (ADDRESS * top, const char *s) terminate_buffer (comment, commentlen); last->personal = safe_strdup (comment); } -#ifdef EXACT_ADDRESS - if (last && !last->val) - last->val = str_substrdup (begin, s); -#endif /* add group terminator */ cur = rfc822_new_address (); @@ -451,10 +436,6 @@ ADDRESS *rfc822_parse_adrlist (ADDRESS * top, const char *s) terminate_buffer (comment, commentlen); last->personal = safe_strdup (comment); } -#ifdef EXACT_ADDRESS - if (last) - last->val = str_substrdup (begin, s); -#endif return top; } @@ -508,28 +489,6 @@ void rfc822_write_address_single (char *buf, size_t buflen, ADDRESS * addr, buflen--; /* save room for the terminal nul */ -#ifdef EXACT_ADDRESS - if (addr->val) { - if (!buflen) - goto done; - strfcpy (pbuf, addr->val, buflen); - len = safe_strlen (pbuf); - /* dirty fix to un-break EXACT_ADDRESS */ - if (pbuf[len-1] == '\n') - pbuf[--len] = '\0'; - pbuf += len; - buflen -= len; - if (addr->group) { - if (!buflen) - goto done; - *pbuf++ = ':'; - buflen--; - *pbuf = 0; - } - return; - } -#endif - if (addr->personal) { if (strpbrk (addr->personal, RFC822Specials)) { if (!buflen) @@ -681,9 +640,6 @@ ADDRESS *rfc822_cpy_adr_real (ADDRESS * addr) { ADDRESS *p = rfc822_new_address (); -#ifdef EXACT_ADDRESS - p->val = safe_strdup (addr->val); -#endif p->personal = safe_strdup (addr->personal); p->mailbox = safe_strdup (addr->mailbox); p->group = addr->group; diff --git a/rfc822.h b/rfc822.h index 0a4ee8e..0668be1 100644 --- a/rfc822.h +++ b/rfc822.h @@ -21,9 +21,6 @@ enum { }; typedef struct address_t { -#ifdef EXACT_ADDRESS - char *val; /* value of address as parsed */ -#endif char *personal; /* real name of address */ char *mailbox; /* mailbox and host address */ int group; /* group mailbox? */ -- 2.20.1