/[mailutils]/mailutils/mh/mh_format.c
ViewVC logotype

Diff of /mailutils/mh/mh_format.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.40 by gray, Sun Sep 21 15:39:21 2003 UTC revision 1.41 by gray, Sat Oct 11 12:09:12 2003 UTC
# Line 1723  builtin_formataddr (struct mh_machine *m Line 1723  builtin_formataddr (struct mh_machine *m
1723  {  {
1724    address_t addr, dest;    address_t addr, dest;
1725    size_t size;    size_t size;
1726      int i;
1727      size_t num;
1728      char *buf;
1729        
1730    if (strobj_len (&mach->reg_str) == 0)    if (strobj_len (&mach->reg_str) == 0)
1731      dest = NULL;      dest = NULL;
# Line 1735  builtin_formataddr (struct mh_machine *m Line 1738  builtin_formataddr (struct mh_machine *m
1738        return;        return;
1739      }      }
1740    
1741    if (addrlist_lookup (mach->addrlist, addr))    address_get_count (addr, &num);
1742      for (i = 1; i <= num; i++)
1743      {      {
1744        address_destroy (&dest);        if (address_aget_email (addr, i, &buf) == 0)
       address_destroy (&addr);  
       return;  
     }  
     
   if (rcpt_mask & RCPT_ME)  
     address_union (&dest, addr);  
   else  
     {  
       int i;  
       size_t num;  
       char *buf;  
         
       address_get_count (addr, &num);  
       for (i = 1; i <= num; i++)  
1745          {          {
1746            if (address_aget_email (addr, i, &buf) == 0)            if ((rcpt_mask & RCPT_ME) || !mh_is_my_name (buf))
1747              {              {
1748                if (!mh_is_my_name (buf))                address_t subaddr;
1749                  address_get_nth (addr, i, &subaddr);
1750                  if (!addrlist_lookup (mach->addrlist, subaddr))
1751                  {                  {
1752                    address_t subaddr;                    list_append (mach->addrlist, subaddr);
                   address_get_nth (addr, i, &subaddr);  
1753                    address_union (&dest, subaddr);                    address_union (&dest, subaddr);
                   address_destroy (&subaddr);  
1754                  }                  }
1755                free (buf);                else
1756                    address_destroy (&subaddr);
1757              }              }
1758              free (buf);
1759          }          }
1760      }      }
1761    list_append (mach->addrlist, addr);  
1762    if (address_to_string (dest, NULL, 0, &size) == 0)    if (address_to_string (dest, NULL, 0, &size) == 0)
1763      {      {
1764        strobj_realloc (&mach->reg_str, size + 1);        strobj_realloc (&mach->reg_str, size + 1);

Legend:
Removed from v.1.40  
changed lines
  Added in v.1.41

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26