if (*s == CR || *s == LF)
if (*s == nsCRT::CR || *s == nsCRT::LF)
mime_LineBuffer (const char *net_buffer, PRInt32 net_buffer_size,				char **bufferP, PRInt32 *buffer_sizeP, PRUint32 *buffer_fpP,				PRBool convert_newlines_p,				PRInt32 (*PR_CALLBACK per_line_fn) (char *line, PRUint32 line_length,									  void *closure),				void *closure){  int status = 0;  if (*buffer_fpP > 0 && *bufferP && (*bufferP)[*buffer_fpP - 1] == CR &&	  net_buffer_size > 0 && net_buffer[0] != LF) {	/* The last buffer ended with a CR.  The new buffer does not start	   with a LF.  This old buffer should be shipped out and discarded. */	PR_ASSERT((PRUint32) *buffer_sizeP > *buffer_fpP);	if ((PRUint32) *buffer_sizeP <= *buffer_fpP) return -1;	status = convert_and_send_buffer(*bufferP, *buffer_fpP,										 convert_newlines_p,										 per_line_fn, closure);	if (status < 0) return status;	*buffer_fpP = 0;  }  while (net_buffer_size > 0)	{	  const char *net_buffer_end = net_buffer + net_buffer_size;	  const char *newline = 0;	  const char *s;	  for (s = net_buffer; s < net_buffer_end; s++)		{		  /* Move forward in the buffer until the first newline.			 Stop when we see CRLF, CR, or LF, or the end of the buffer.			 *But*, if we see a lone CR at the *very end* of the buffer,			 treat this as if we had reached the end of the buffer without			 seeing a line terminator.  This is to catch the case of the			 buffers splitting a CRLF pair, as in "FOO\r\nBAR\r" "\nBAZ\r\n".		   */		  if (*s == CR || *s == LF)			{			  newline = s;			  if (newline[0] == CR)				{				  if (s == net_buffer_end - 1)					{					  /* CR at end - wait for the next character. */					  newline = 0;					  break;					}				  else if (newline[1] == LF)					/* CRLF seen; swallow both. */					newline++;				}			  newline++;			  break;			}		}	  /* Ensure room in the net_buffer and append some or all of the current		 chunk of data to it. */	  {		const char *end = (newline ? newline : net_buffer_end);		PRUint32 desired_size = (end - net_buffer) + (*buffer_fpP) + 1;		if (desired_size >= (PRUint32) (*buffer_sizeP))		  {			status = mime_GrowBuffer (desired_size, sizeof(char), 1024,									 bufferP, buffer_sizeP);			if (status < 0) return status;		  }		nsCRT::memcpy ((*bufferP) + (*buffer_fpP), net_buffer, (end - net_buffer));		(*buffer_fpP) += (end - net_buffer);	  }	  /* Now *bufferP contains either a complete line, or as complete		 a line as we have read so far.		 If we have a line, process it, and then remove it from `*bufferP'.		 Then go around the loop again, until we drain the incoming data.	   */	  if (!newline)		return 0;	  status = convert_and_send_buffer(*bufferP, *buffer_fpP,										   convert_newlines_p,										   per_line_fn, closure);	  if (status < 0)       return status;	  net_buffer_size -= (newline - net_buffer);	  net_buffer = newline;	  (*buffer_fpP) = 0;	}  return 0;}