for(lp = *ldata; lp; lp = lastp->next)
for(lp = *ldata; lp; )
static int parse_unattach_list (BUFFER *buf, BUFFER *s, LIST **ldata, BUFFER *err){  ATTACH_MATCH *a;  LIST *lp, *lastp;  char *tmp;  int major;  char *minor;  do  {    mutt_extract_token (buf, s, 0);    if (!mutt_strcasecmp(buf->data, "any"))      tmp = safe_strdup("*/.*");    else if (!mutt_strcasecmp(buf->data, "none"))      tmp = safe_strdup("cheap_hack/this_should_never_match");    else      tmp = safe_strdup(buf->data);    if ((minor = strchr(tmp, '/')))    {      *minor = '\0';      ++minor;    }    else    {      minor = "unknown";    }    major = mutt_check_mime_type(tmp);    lastp = NULL;    for(lp = *ldata; lp; lp = lastp->next)    {      a = (ATTACH_MATCH *)lp->data;      dprint(5, (debugfile, "parse_unattach_list: check %s/%s [%d] : %s/%s [%d]\n",		  a->major, a->minor, a->major_int, tmp, minor, major));      if (a->major_int == major && !mutt_strcasecmp(minor, a->minor))      {	dprint(5, (debugfile, "parse_unattach_list: removed %s/%s [%d]\n",		    a->major, a->minor, a->major_int));	regfree(&a->minor_rx);        FREE(&a->major);        if (lastp)	{          lastp->next = lp->next;	}	lastp = lp;        FREE (&lp->data);	/* same as a */        FREE (&lp);      }      lastp = lp;      lp = lp->next;    }    remove_from_list (ldata, buf->data);  }  while (MoreArgs (s));     _attachments_clean();  return 0;}