if (tree->virtual >= 0 || (tree->collapsed && (!ctx->pattern || tree->limited)))
if (visible)
void mutt_linearize_tree (CONTEXT *ctx, int linearize){  char *pfx = NULL, *mypfx = NULL, *arrow = NULL, *myarrow = NULL;  char corner = Sort & SORT_REVERSE ? M_TREE_ULCORNER : M_TREE_LLCORNER;  int depth = 0, start_depth = 0, max_depth = 0, max_width = 0;  int nextdisp = 0;  HEADER *tree = ctx->tree;  HEADER **array = ctx->hdrs + (Sort & SORT_REVERSE ? ctx->msgcount - 1 : 0);  /* A NULL tree should never be passed here, but may occur if there is   * a cycle.     */  if (!tree)    return;  FOREVER  {    if (tree->virtual >= 0 || (tree->collapsed && (!ctx->pattern || tree->limited)))      tree->display_subject = need_display_subject (ctx, tree);    if (depth >= max_depth)      safe_realloc ((void **) &pfx,		    (max_depth += 32) * 2 * sizeof (char));    if (depth - start_depth >= max_width)      safe_realloc ((void **) &arrow,		    (max_width += 16) * 2 * sizeof (char));    safe_free ((void **) &tree->tree);    if (!depth)    {      if (tree->virtual >= 0 || (tree->collapsed && (!ctx->pattern || tree->limited)))	tree->tree = safe_strdup ("");    }    else    {      myarrow = arrow + (depth - start_depth - (start_depth ? 0 : 1)) * 2;      nextdisp = is_next_displayed (ctx, tree);            if (depth && start_depth == depth)	myarrow[0] = nextdisp ? M_TREE_LTEE : corner;      else	myarrow[0] = M_TREE_HIDDEN;      myarrow[1] = tree->fake_thread ? M_TREE_STAR : M_TREE_HLINE;      if (tree->virtual >= 0 || (tree->collapsed && (!ctx->pattern || tree->limited)))      {	myarrow[2] = M_TREE_RARROW;	myarrow[3] = 0;      }      if (tree->virtual >= 0 || (tree->collapsed && (!ctx->pattern || tree->limited)))      {	tree->tree = safe_malloc ((2 + depth * 2) * sizeof (char));	if (start_depth > 1)	{	  strncpy (tree->tree, pfx, (start_depth - 1) * 2);	  strfcpy (tree->tree + (start_depth - 1) * 2,		   arrow, (2 + depth - start_depth) * 2);	}	else	  strfcpy (tree->tree, arrow, 2 + depth * 2);      }    }    if (linearize)    {      *array = tree;      array += Sort & SORT_REVERSE ? -1 : 1;    }    if (tree->child)    {      if (depth)      {	mypfx = pfx + (depth - 1) * 2;	mypfx[0] = nextdisp ? M_TREE_VLINE : M_TREE_SPACE;	mypfx[1] = M_TREE_SPACE;      }      depth++;      if (tree->virtual >= 0 || (tree->collapsed && (!ctx->pattern || tree->limited)))        start_depth = depth;      tree = tree->child;    }    else    {      while (!tree->next && tree->parent)      {	if (tree->virtual >= 0 || (tree->collapsed && (!ctx->pattern || tree->limited)))	  start_depth = depth;	tree = tree->parent;	if (start_depth == depth)	  start_depth--;	depth--;      }      if (tree->virtual >= 0 || (tree->collapsed && (!ctx->pattern || tree->limited)))	start_depth = depth;      if ((tree = tree->next) == NULL)	break;    }  }  safe_free ((void **) &pfx);  safe_free ((void **) &arrow);}