+
+ /* skip empty data children */
+ while (is_empty_data(data))
+ data = data->next;
+ if (!data)
+ data = n->child;
+ else
+ { /* got one. see if this is the only non-empty one */
+ data1_node *sub = data->next;
+ while (sub && is_empty_data(sub))
+ sub = sub->next;
+ if (!sub)
+ leaf = 1; /* all empty. 'data' is the only child */
+ }