char *p = safe_strdup (s); char *pp = p; char *pd = d; char *t; int enc = 0, filter = 0, count = 0, c1, c2, c3, c4;
const char *pp = s, *pp1; char *pd, *d0; char *t, *t1; int enc = 0, count = 0, c1, c2, c3, c4;
static int rfc2047_decode_word (char *d, const char *s, size_t len){  char *p = safe_strdup (s);  char *pp = p;  char *pd = d;  char *t;  int enc = 0, filter = 0, count = 0, c1, c2, c3, c4;  char *charset = NULL;  size_t olen = len;  while ((pp = strtok (pp, "?")) != NULL)  {    count++;    switch (count)    {      case 2:	/* ignore language specification a la RFC 2231 */                if ((t = strchr (pp, '*')))	  *t = '\0';        charset = pp;        filter = 1;	break;      case 3:	if (toupper (*pp) == 'Q')	  enc = ENCQUOTEDPRINTABLE;	else if (toupper (*pp) == 'B')	  enc = ENCBASE64;	else	  return (-1);	break;      case 4:	if (enc == ENCQUOTEDPRINTABLE)	{	  while (*pp && len > 0)	  {	    if (*pp == '_')	    {	      *pd++ = ' ';	      len--;	    }	    else if (*pp == '=')	    {	      if (pp[1] == 0 || pp[2] == 0)		break;	/* something wrong */	      *pd++ = (hexval(pp[1]) << 4) | hexval(pp[2]);	      len--;	      pp += 2;	    }	    else	    {	      *pd++ = *pp;	      len--;	    }	    pp++;	  }	  *pd = 0;	}	else if (enc == ENCBASE64)	{	  while (*pp && len > 0)	  {	    if (pp[0] == '=' || pp[1] == 0 || pp[1] == '=')	      break;  /* something wrong */	    c1 = base64val(pp[0]);	    c2 = base64val(pp[1]);	    *pd++ = (c1 << 2) | ((c2 >> 4) & 0x3);	    if (--len == 0) break;	    	    if (pp[2] == 0 || pp[2] == '=') break;	    c3 = base64val(pp[2]);	    *pd++ = ((c2 & 0xf) << 4) | ((c3 >> 2) & 0xf);	    if (--len == 0)	      break;	    if (pp[3] == 0 || pp[3] == '=')	      break;	    c4 = base64val(pp[3]);	    *pd++ = ((c3 & 0x3) << 6) | c4;	    if (--len == 0)	      break;	    pp += 4;	  }	  *pd = 0;	}	break;    }    pp = 0;  }    if (filter)    mutt_convert_string (d, olen, charset, Charset);  safe_free ((void **) &p);  return (0);}