snprintf(pt, dlen, "%s\"%s\"", tmp, NONULL (*((char **) MuttVars[idx].data)));
{ strfcpy (tmp, NONULL (*((char **) MuttVars[idx].data)), sizeof (tmp)); if (DTYPE (MuttVars[idx].type) == DT_PATH) mutt_pretty_mailbox (tmp); }
int mutt_var_value_complete (char *buffer, size_t len, int pos){  char var[STRING], *pt = buffer;  int spaces;    if (buffer[0] == 0)    return 0;  SKIPWS (buffer);  spaces = buffer - pt;  pt = buffer + pos - spaces;  while ((pt > buffer) && !isspace ((unsigned char) *pt))    pt--;  pt++; /* move past the space */  if (*pt == '=') /* abort if no var before the '=' */    return 0;  if (mutt_strncmp (buffer, "set", 3) == 0)  {    int idx;    strfcpy (var, pt, sizeof (var));    /* ignore the trailing '=' when comparing */    var[mutt_strlen (var) - 1] = 0;    if ((idx = mutt_option_index (var)) == -1)       return 0; /* no such variable. */    else    {      char tmp [LONG_STRING];      size_t dlen = buffer + len - pt - spaces;      char *vals[] = { "no", "yes", "ask-no", "ask-yes" };      strfcpy (tmp, pt, sizeof(tmp));            if ((DTYPE(MuttVars[idx].type) == DT_STR) || 	  (DTYPE(MuttVars[idx].type) == DT_PATH) ||	  (DTYPE(MuttVars[idx].type) == DT_RX))	snprintf(pt, dlen, "%s\"%s\"", tmp, 		  NONULL (*((char **) MuttVars[idx].data)));      else if (DTYPE (MuttVars[idx].type) == DT_ADDR)      {	*pt = '\0';	rfc822_write_address (pt, dlen, *((ADDRESS **) MuttVars[idx].data));      }      else if (DTYPE (MuttVars[idx].type) == DT_QUAD)	snprintf(pt, dlen, "%s%s", tmp,  vals[quadoption (MuttVars[idx].data)]);      else if (DTYPE (MuttVars[idx].type) == DT_NUM)	snprintf (pt, dlen, "%s%d", tmp, (*((short *) MuttVars[idx].data)));      else if (DTYPE (MuttVars[idx].type) == DT_SORT)      {	const struct mapping_t *map;	char *p;	switch (MuttVars[idx].type & DT_SUBTYPE_MASK)	{	  case DT_SORT_ALIAS:	    map = SortAliasMethods;	    break;	  case DT_SORT_BROWSER:	    map = SortBrowserMethods;	    break;#ifdef _PGPPATH	  case DT_SORT_KEYS:	    map = SortKeyMethods;	    break;#endif	  default:	    map = SortMethods;	    break;	}	p = mutt_getnamebyvalue (*((short *) MuttVars[idx].data) & SORT_MASK, map);	snprintf (pt, dlen, "%s\"%s%s%s\"", tmp,		  (*((short *) MuttVars[idx].data) & SORT_REVERSE) ? "reverse-" : "",		  (*((short *) MuttVars[idx].data) & SORT_LAST) ? "last-" : "",		  p);      }      else if (DTYPE (MuttVars[idx].type) == DT_BOOL)	snprintf (pt, dlen, "%s%s", tmp, 		  option (MuttVars[idx].data) ? "yes" : "no");      else	return 0;      return 1;    }  }  return 0;}