char * startRecipient = addresses;
static nsresult StripOutGroupNames(char * addresses){  char aChar;  char * readPtr = addresses;           // current read position  char * writePtr = addresses;          // current write position  char * startRecipient = addresses;    // begining of the current recipient (or potential group name)  char * previousSeparator = addresses; // remember last time we wrote a recipient separator  char * endPtr = addresses + PL_strlen(addresses);  PRBool quoted = PR_FALSE;   // indicate if we are between double quote  PRBool group = PR_FALSE;   // indicate if we found a group prefix  PRBool atFound = PR_FALSE;  // indicate if we found an @ in the current recipient. group name should not have an @  while (readPtr < endPtr)  {    aChar = *readPtr;    readPtr ++;    switch(aChar)    {      case '\\':        if (*readPtr == '"') //ignore escaped quote          readPtr ++;        continue;      case '"':        quoted = !quoted;        break;      case '@':        if (!quoted)          atFound = PR_TRUE;        break;      case ':':        if (!quoted && !atFound)        {          // ok, we found a group name          // let's backup the write cursor to remove the group name          writePtr = previousSeparator + 1;          group = PR_TRUE;          continue;        }        break;      case ';':        if (quoted || !group)          break;        else          group = PR_FALSE;          //end of the group, act like a recipient separator now...        /* NO BREAK */      case ',':        if (!quoted)        {          atFound = PR_FALSE;          //let check if we already have a comma separator in the output string          if (writePtr > addresses && *(writePtr - 1) == ',')            writePtr --;          *writePtr = ',';          previousSeparator = writePtr;          writePtr ++;          continue;        }        break;    }    *writePtr = aChar;    writePtr ++;  }  if (writePtr > addresses && *(writePtr - 1) == ',')    writePtr --;  *writePtr = '\0';  return NS_OK;}