else if (token[1] == CR || token[1] == LF)
else if (token[1] == nsCRT::CR || token[1] == nsCRT::LF)
mime_decode_qp_buffer (MimeDecoderData *data, const char *buffer, PRInt32 length){  /* Warning, we are overwriting the buffer which was passed in.	 This is ok, because decoding these formats will never result	 in larger data than the input, only smaller. */  const char *in  = buffer;  char *out = (char *) buffer;  char token [3];  int i;  PR_ASSERT(data->encoding == mime_QuotedPrintable);  if (data->encoding != mime_QuotedPrintable) return -1;  /* For the first pass, initialize the token from the unread-buffer. */  i = 0;  while (i < 3 && data->token_size > 0)	{	  token [i] = data->token[i];	  data->token_size--;	  i++;	}  /* #### BUG: when decoding quoted-printable, we are required to	 strip trailing whitespace from lines -- since when encoding in	 qp, one is required to quote such trailing whitespace, any	 trailing whitespace which remains must have been introduced	 by a stupid gateway. */  while (length > 0 || i != 0)	{	  while (i < 3 && length > 0)		{		  token [i++] = *in;		  in++;		  length--;		}	  if (i < 3)		{		  /* Didn't get enough for a complete token.			 If it might be a token, unread it.			 Otherwise, just dump it.			 */		  nsCRT::memcpy (data->token, token, i);		  data->token_size = i;		  i = 0;		  length = 0;		  break;		}	  i = 0;	  if (token [0] == '=')		{		  unsigned char c = 0;		  if (token[1] >= '0' && token[1] <= '9')			c = token[1] - '0';		  else if (token[1] >= 'A' && token[1] <= 'F')			c = token[1] - ('A' - 10);		  else if (token[1] >= 'a' && token[1] <= 'f')			c = token[1] - ('a' - 10);		  else if (token[1] == CR || token[1] == LF)			{			  /* =\n means ignore the newline. */			  if (token[1] == CR && token[2] == LF)				;		/* swallow all three chars */			  else				{				  in--;	/* put the third char back */				  length++;				}			  continue;			}		  else			{			  /* = followed by something other than hex or newline -				 pass it through unaltered, I guess.  (But, if				 this bogus token happened to occur over a buffer				 boundary, we can't do this, since we don't have				 space for it.  Oh well.  Screw it.)  */			  if (in > out) *out++ = token[0];			  if (in > out) *out++ = token[1];			  if (in > out) *out++ = token[2];			  continue;			}		  /* Second hex digit */		  c = (c << 4);		  if (token[2] >= '0' && token[2] <= '9')			c += token[2] - '0';		  else if (token[2] >= 'A' && token[2] <= 'F')			c += token[2] - ('A' - 10);		  else if (token[2] >= 'a' && token[2] <= 'f')			c += token[2] - ('a' - 10);		  else			{			  /* We got =xy where "x" was hex and "y" was not, so				 treat that as a literal "=", x, and y.  (But, if				 this bogus token happened to occur over a buffer				 boundary, we can't do this, since we don't have				 space for it.  Oh well.  Screw it.) */			  if (in > out) *out++ = token[0];			  if (in > out) *out++ = token[1];			  if (in > out) *out++ = token[2];			  continue;			}		  *out++ = (char) c;		}	  else		{		  *out++ = token[0];		  token[0] = token[1];		  token[1] = token[2];		  i = 2;		}	}  /* Now that we've altered the data in place, write it. */  if (out > buffer)	return data->write_buffer (buffer, (out - buffer), data->closure);  else	return 1;}