if (vector_active (start->children))
{
if (vector_active (start->children) == 1)
- pretty_print_graph (vector_slot (start->children, 0), level);
+ {
+ struct graph_node *child = vector_slot (start->children, 0);
+ if (child == start)
+ fprintf (stdout, "*");
+ else
+ pretty_print_graph (vector_slot (start->children, 0), level);
+ }
else
{
fprintf(stdout, "\n");
struct graph_node *r = vector_slot (start->children, i);
for (int j = 0; j < level+1; j++)
fprintf (stdout, " ");
- pretty_print_graph (r, level+1);
+ if (r == start)
+ fprintf (stdout, "*");
+ else
+ pretty_print_graph (r, level+1);
}
}
}