Hi,
I had problems with the newest cvs version of Mahogany since the character ':' and '/' 
no
longer work for user names. I have mail accounts with ISPs that use those.

As a quick hack I added support for escaping sequence 0xDD where DD is a hex number.

The (ugly, quick, don't look, memory leaking) code is this:

src/mail/MailFolderCC.cpp:

int is_hex(char c) {
  if ((c >= '0') && (c <= '9'))
    return c-'0';
  if ((c >= 'A') && (c <= 'F'))
    return c-'A'+10;
  if ((c >= 'a') && (c <= 'f'))
    return c-'a'+10;
  return -1;
}

char *unescape(const char * usr) {
  char *p,*ps,*pd;
  char *ut=strdup(usr);
  p=ut;
  while (*p) {
    if ((*p=='0') && (*(p+1)) && (*(p+1)=='x') && (*(p+2)) && (is_hex(*(p+2))!=-1) && 
(*(p+3)) &&
(is_hex(*(p+3))!=-1)) {
      *p=is_hex(*(p+2))*16 + is_hex(*(p+3));
      ps=p+4;
      pd=p+1;
      while (*ps)
      *pd++=*ps++;
      *pd=0;
    }
    p++;
  }
  return ut;
}

/* static */
void
MailFolderCC::SetLoginData(const String &user, const String &pw)
{
   MailFolderCC::MF_user = unescape(user);
   MailFolderCC::MF_pwd = pw;
}


br
/Martin




-------------------------------------------------------
This sf.net email is sponsored by:
With Great Power, Comes Great Responsibility 
Learn to use your power at OSDN's High Performance Computing Channel
http://hpc.devchannel.org/
_______________________________________________
Mahogany-Users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/mahogany-users

Reply via email to