| 1611 | } |
| 1612 | |
| 1613 | char_t* strconv_cdata(char_t* s, char_t endch) |
| 1614 | { |
| 1615 | gap g; |
| 1616 | |
| 1617 | while (true) |
| 1618 | { |
| 1619 | while (!IS_CHARTYPE(*s, ct_parse_cdata)) ++s; |
| 1620 | |
| 1621 | if (*s == '\r') // Either a single 0x0d or 0x0d 0x0a pair |
| 1622 | { |
| 1623 | *s++ = '\n'; // replace first one with 0x0a |
| 1624 | |
| 1625 | if (*s == '\n') g.push(s, 1); |
| 1626 | } |
| 1627 | else if (s[0] == ']' && s[1] == ']' && ENDSWITH(s[2], '>')) // CDATA ends here |
| 1628 | { |
| 1629 | *g.flush(s) = 0; |
| 1630 | |
| 1631 | return s + 1; |
| 1632 | } |
| 1633 | else if (*s == 0) |
| 1634 | { |
| 1635 | return 0; |
| 1636 | } |
| 1637 | else ++s; |
| 1638 | } |
| 1639 | } |
| 1640 | |
| 1641 | typedef char_t* (*strconv_pcdata_t)(char_t*); |
| 1642 |
no test coverage detected