diff options
author | Alexander Barkov <bar@mnogosearch.org> | 2014-04-23 17:43:20 +0400 |
---|---|---|
committer | Alexander Barkov <bar@mnogosearch.org> | 2014-04-23 17:43:20 +0400 |
commit | 64d33032a6b780a345418ebcab2edd5fb68bfe0d (patch) | |
tree | a0c46cfca9f921a8565489987abbb6a09266e297 /strings | |
parent | 2f93e7cf4766ee53d38343dbc46c12bdcc134601 (diff) | |
parent | a24ea50d1a04d7bfe9608fe1ea8ac1ab8ed97294 (diff) | |
download | mariadb-git-64d33032a6b780a345418ebcab2edd5fb68bfe0d.tar.gz |
Merge 5.3->5.5
Diffstat (limited to 'strings')
-rw-r--r-- | strings/xml.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/strings/xml.c b/strings/xml.c index 3b2c278f553..531fdc83eaa 100644 --- a/strings/xml.c +++ b/strings/xml.c @@ -239,7 +239,7 @@ static void mstr(char *s,const char *src,size_t l1, size_t l2) static int my_xml_leave(MY_XML_PARSER *p, const char *str, size_t slen) { - char *e; + char *e, *tag; size_t glen; char s[32]; char g[32]; @@ -248,13 +248,14 @@ static int my_xml_leave(MY_XML_PARSER *p, const char *str, size_t slen) /* Find previous '/' or beginning */ for (e=p->attrend; (e>p->attr) && (e[0] != '/') ; e--); glen = (size_t) ((e[0] == '/') ? (p->attrend-e-1) : p->attrend-e); - - if (str && (slen != glen)) + tag= e[0] == '/' ? e + 1 : e; + + if (str && (slen != glen || memcmp(str, tag, slen))) { mstr(s,str,sizeof(s)-1,slen); if (glen) { - mstr(g,e+1,sizeof(g)-1,glen), + mstr(g, tag, sizeof(g)-1, glen); sprintf(p->errstr,"'</%s>' unexpected ('</%s>' wanted)",s,g); } else |