[gmime-devel] address parsing strictness in 3.0




Here's an example program that cleans up and round trips the address in
gmime 2.6, but fails in gmime 3.0

I'm not sure if this is a bug or not, since the input is clearly malformed.

#include <gmime/gmime.h>

#define STRING "Mangled Sender \\<mangled_test notmuchmail org\\>"
#if (GMIME_MAJOR_VERSION >= 3)
#define internet_address_list_to_string(ia,encode) internet_address_list_to_string (ia,NULL,encode)
#define internet_address_list_parse_string(str) internet_address_list_parse (NULL,str)
#endif

int
main (int argc, char **argv)
{
  InternetAddressList *list;
  char *string;

#if (GMIME_MAJOR_VERSION >= 3)
        g_mime_init ();
#else
        g_mime_init (0);
#endif


  list = internet_address_list_parse_string (STRING);
  if (list) {
    string = internet_address_list_to_string (list, FALSE);
    fprintf (stderr, "%s\n", string);
  }
}



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]