((tail[0] == CR || tail[0] == LF) && !(tail[1] == ' ' || tail[1] == '\t' || tail[1] == LF)))
((tail[0] == nsCRT::CR || tail[0] == nsCRT::LF) && !(tail[1] == ' ' || tail[1] == '\t' || tail[1] == nsCRT::LF)))
divide_content_headers(const char *headers,                        char **message_headers,                        char **content_headers,                        char **content_type_header){    const char *tail;    char *message_tail, *content_tail, *type_tail;    int L = 0;    if (headers)      L = PL_strlen(headers);        if (L == 0)      return 0;        *message_headers = (char *)PR_Malloc(L+1);    if (!*message_headers)      return NS_ERROR_OUT_OF_MEMORY;        *content_headers = (char *)PR_Malloc(L+1);    if (!*content_headers) {      PR_Free(*message_headers);      return NS_ERROR_OUT_OF_MEMORY;    }        *content_type_header = (char *)PR_Malloc(L+1);    if (!*content_type_header) {      PR_Free(*message_headers);      PR_Free(*content_headers);      return NS_ERROR_OUT_OF_MEMORY;    }        message_tail = *message_headers;    content_tail = *content_headers;    type_tail    = *content_type_header;    tail = headers;        while (*tail)    {      const char *head = tail;      char **out;      while(PR_TRUE) {      /* Loop until we reach a newline that is not followed by whitespace.        */        if (tail[0] == 0 ||          ((tail[0] == CR || tail[0] == LF) &&          !(tail[1] == ' ' || tail[1] == '\t' || tail[1] == LF)))        {          /* Swallow the whole newline. */          if (tail[0] == CR && tail[1] == LF)            tail++;          if (*tail)            tail++;          break;        }        tail++;      }            /* Decide which block this header goes into.      */      if (!PL_strncasecmp(head, "Content-Type:", 13))        out = &type_tail;      else        if (!PL_strncasecmp(head, "Content-", 8))          out = &content_tail;        else          out = &message_tail;                memcpy(*out, head, (tail-head));        *out += (tail-head);    }        *message_tail = 0;    *content_tail = 0;    *type_tail = 0;        if (!**message_headers) {      PR_Free(*message_headers);      *message_headers = 0;    }        if (!**content_headers) {      PR_Free(*content_headers);      *content_headers = 0;    }        if (!**content_type_header) {      PR_Free(*content_type_header);      *content_type_header = 0;    }    #ifdef DEBUG    // ### mwelch	Because of the extreme difficulty we've had with    //			duplicate part headers, I'm going to put in an    //			ASSERT here which makes sure that no duplicate    //			Content-Type or Content-Transfer-Encoding headers    //			leave here undetected.    const char* tmp;    if (*content_type_header) {      tmp = PL_strstr(*content_type_header, "Content-Type");      if (tmp) {        tmp++; // get past the first occurrence        NS_ASSERTION(!PL_strstr(tmp, "Content-Type"), "Content-part already present");      }    }        if (*content_headers) {      tmp = PL_strstr(*content_headers, "Content-Transfer-Encoding");      if (tmp) {        tmp++; // get past the first occurrence        NS_ASSERTION(!PL_strstr(tmp, "Content-Transfer-Encoding"), "Content-Transfert already present");      }    }#endif // DEBUG        return 0;}