for (i = 0 ; a->name[i] && a->name[i] == bestname[i] ; i++) ; bestname[i] = 0;
if (!bestname[0])  strfcpy (bestname, a->name, min (mutt_strlen (a->name) + 1, sizeof (bestname))); else { for (i = 0 ; a->name[i] && a->name[i] == bestname[i] ; i++) ; bestname[i] = 0; }
int mutt_alias_complete (char *s, size_t buflen){  ALIAS *a = Aliases;  ALIAS *a_list = NULL, *a_cur = NULL;  char bestname[STRING];  int i;  memset (bestname, 0, sizeof (bestname));#define min(a,b)        ((a<b)?a:b)  while (a)  {    if (a->name && strstr (a->name, s) == a->name)    {      if (!bestname[0]) /* init */	strfcpy (bestname, a->name, min (mutt_strlen (a->name) + 1, sizeof (bestname)));      else      {	for (i = 0 ; a->name[i] && a->name[i] == bestname[i] ; i++)	  ;	bestname[i] = 0;      }    }    a = a->next;  }  if ((bestname[0] == 0) || /* if we didn't find anything */      (s[0] == 0))          /* or we weren't given anything */  {    mutt_alias_menu (s, buflen, Aliases);    return 0;  }  else  {    if (mutt_strcmp (bestname, s) == 0) /* add anything to the completion? */    {      /* build alias list and show it */      a = Aliases;      while (a)      {	if (a->name && (strstr (a->name, s) == a->name))	{	  if (!a_list)  /* init */	    a_cur = a_list = (ALIAS *) safe_malloc (sizeof (ALIAS));	  else	  {	    a_cur->next = (ALIAS *) safe_malloc (sizeof (ALIAS));	    a_cur = a_cur->next;	  }	  memcpy (a_cur, a, sizeof (ALIAS));	  a_cur->next = NULL;	}	a = a->next;      }      s[0] = 0; /* reset string before passing to alias_menu */      mutt_alias_menu (s, buflen, a_list);      /* free the alias list */      while (a_list)      {	a_cur = a_list;	a_list = a_list->next;	safe_free ((void **) &a_cur);      }      return 0;    }    else /* we are adding something to the completion */      strfcpy (s, bestname, mutt_strlen (bestname) + 1);  }  return 1;}