* Record the requested set of leaf names. The input should be a set * of leaf names, separated by periods. */
| 572 | * of leaf names, separated by periods. |
| 573 | */ |
| 574 | static int |
| 575 | csv_record_leafs (xo_handle_t *xop, csv_private_t *csv, const char *leafs_raw) |
| 576 | { |
| 577 | char *cp, *ep, *np; |
| 578 | ssize_t len = strlen(leafs_raw); |
| 579 | char *leafs_buf = alloca(len + 1); |
| 580 | |
| 581 | memcpy(leafs_buf, leafs_raw, len + 1); /* Make local copy */ |
| 582 | |
| 583 | for (cp = leafs_buf, ep = leafs_buf + len; cp && cp < ep; cp = np) { |
| 584 | np = strchr(cp, '.'); |
| 585 | if (np) |
| 586 | *np++ = '\0'; |
| 587 | |
| 588 | if (*cp == '\0') /* Skip empty names */ |
| 589 | continue; |
| 590 | |
| 591 | csv_dbg(xop, csv, "adding leaf: [%s]\n", cp); |
| 592 | csv_leaf_num(xop, csv, cp, 0); |
| 593 | } |
| 594 | |
| 595 | /* |
| 596 | * Since we've been told explicitly what leafs matter, ignore the rest |
| 597 | */ |
| 598 | csv->c_flags |= CF_LEAFS_DONE; |
| 599 | |
| 600 | return 0; |
| 601 | } |
| 602 | |
| 603 | /* |
| 604 | * Record the requested path elements. The input should be a set of |
no test coverage detected