| 124 | static acl_pthread_once_t __token_once = ACL_PTHREAD_ONCE_INIT; |
| 125 | |
| 126 | static const char* markup_unescape(const char* in, ACL_VSTRING* out) |
| 127 | { |
| 128 | unsigned int n; |
| 129 | char temp[2], buf[7]; |
| 130 | |
| 131 | while (*in != 0) { |
| 132 | if (*in == '&' && *(in + 1) == '#' |
| 133 | && (sscanf(in, "&#%u%1[;]", &n, temp) == 2 |
| 134 | || sscanf(in, "&#x%x%1[;]", &n, temp) == 2) |
| 135 | && n != 0) |
| 136 | { |
| 137 | int buflen = uni2utf8(n, buf, sizeof(buf)); |
| 138 | |
| 139 | buf[buflen] = '\0'; |
| 140 | acl_vstring_strcat(out, buf); |
| 141 | |
| 142 | n = *(in + 2) == 'x' ? 3 : 2; |
| 143 | while (isxdigit((int) in[n])) |
| 144 | n++; |
| 145 | if(in[n] == ';') |
| 146 | n++; |
| 147 | in += n; |
| 148 | } else { |
| 149 | ACL_VSTRING_ADDCH(out, (unsigned char) (*in)); |
| 150 | in++; |
| 151 | } |
| 152 | } |
| 153 | |
| 154 | return in; |
| 155 | } |
| 156 | |
| 157 | int acl_xml_decode(const char *in, ACL_VSTRING *out) |
| 158 | { |
no test coverage detected
searching dependent graphs…