version 1.59, 2019/05/02 11:58:18 |
version 1.60, 2019/05/07 23:41:48 |
Line 376 xml_entity(struct parse *p, const char *name) |
|
Line 376 xml_entity(struct parse *p, const char *name) |
|
struct pnode *n; |
struct pnode *n; |
const char *ccp; |
const char *ccp; |
char *cp; |
char *cp; |
unsigned int codepoint; |
long codepoint; |
enum pstate pstate; |
enum pstate pstate; |
|
|
if (p->del > 0) |
if (p->del > 0) |
Line 421 xml_entity(struct parse *p, const char *name) |
|
Line 421 xml_entity(struct parse *p, const char *name) |
|
} |
} |
} |
} |
if (*name == '#') { |
if (*name == '#') { |
codepoint = strtonum(name + 1, 0, 0x10ffff, &ccp); |
errno = 0; |
if (ccp == NULL) { |
if (name[1] == 'x') { |
|
ccp = name + 2; |
|
codepoint = strtol(ccp, &cp, 16); |
|
} else { |
|
ccp = name + 1; |
|
codepoint = strtol(ccp, &cp, 10); |
|
} |
|
if (*ccp != '\0' && *cp == '\0' && errno != ERANGE && |
|
codepoint >= 0 && codepoint <= 0x10ffff) { |
n = pnode_alloc(p->cur); |
n = pnode_alloc(p->cur); |
xasprintf(&n->b, "\\[u%4.4X]", codepoint); |
xasprintf(&n->b, "\\[u%4.4X]", codepoint); |
goto done; |
goto done; |