Update of /cvsroot/mahogany/M/src/mail
In directory sc8-pr-cvs1:/tmp/cvs-serv533/src/mail

Modified Files:
        AddressCC.cpp 
Log Message:
Ignore local part in whitelist

Index: AddressCC.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/mail/AddressCC.cpp,v
retrieving revision 1.21
retrieving revision 1.22
diff -b -u -2 -r1.21 -r1.22
--- AddressCC.cpp       12 Oct 2003 15:14:01 -0000      1.21
+++ AddressCC.cpp       16 Oct 2003 15:15:46 -0000      1.22
@@ -545,9 +545,54 @@
 }
 
+static String RemoveEmptyListParts(const String &original)
+{
+   String result;
+   bool empty = true;
+   size_t index;
+   
+   // Add everything except commas following other commas
+   for( index = 0; index < original.size(); ++index )
+   {
+      wxChar byte = original[index];
+
+      if( byte != _T(',') )
+      {
+         empty &= wxIsspace(byte);
+         
+         result += byte;
+      }
+      else
+      {
+         if( !empty )
+            result += _T(',');
+         
+         empty = true;
+      }
+   }
+   
+   // Remove trailing comma
+   size_t last = result.rfind(_T(','));
+   if( last != String::npos )
+   {
+      bool trailing = true;
+      for( index = last+1; index < result.size(); ++index )
+      {
+         trailing &= wxIsspace(result[index]);
+      }
+      
+      if( trailing )
+      {
+         result.erase(last);
+      }
+   }
+   
+   return result;
+}
+
 extern ADDRESS *ParseAddressList(const String& address, const String& defhost)
 {
    // NB: rfc822_parse_adrlist() modifies the string passed in, copy them!
 
-   char *addressCopy = strdup(wxConvertWX2MB(address));
+   char *addressCopy = strdup(wxConvertWX2MB(RemoveEmptyListParts(address)));
 
    // use '@' to trick c-client into accepting addresses without host names



-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
SourceForge.net hosts over 70,000 Open Source Projects.
See the people who have HELPED US provide better services:
Click here: http://sourceforge.net/supporters.php
_______________________________________________
Mahogany-cvsupdates mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/mahogany-cvsupdates

Reply via email to