mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-07-29 11:41:22 +03:00
- doc/encoding.html doc/xml.html: added I18N doc
- encoding.[ch] HTMLtree.[ch] parser.c HTMLparser.c: I18N encoding improvements, both parser and filters, added ASCII & HTML, fixed the ISO-Latin-1 one - xmllint.c testHTML.c: added/made visible --encode - debugXML.c : cleanup - most .c files: applied patches due to warning on Windows and when using Sun Pro cc compiler - xpath.c : cleanup memleaks - nanoftp.c : added a TESTING preprocessor flag for standalong compile so that people can report bugs more easilly - nanohttp.c : ditched socklen_t which was a portability mess and replaced it with unsigned int. - tree.[ch]: added xmlHasProp() - TODO: updated - test/ : added more test for entities, NS, encoding, HTML, wap - configure.in: preparing for 2.2.0 release Daniel
This commit is contained in:
18
xpath.c
18
xpath.c
@ -183,7 +183,7 @@ void xmlXPathStringFunction(xmlXPathParserContextPtr ctxt, int nargs);
|
||||
extern int name##Push(xmlXPathParserContextPtr ctxt, type value) { \
|
||||
if (ctxt->name##Nr >= ctxt->name##Max) { \
|
||||
ctxt->name##Max *= 2; \
|
||||
ctxt->name##Tab = (void *) xmlRealloc(ctxt->name##Tab, \
|
||||
ctxt->name##Tab = (type *) xmlRealloc(ctxt->name##Tab, \
|
||||
ctxt->name##Max * sizeof(ctxt->name##Tab[0])); \
|
||||
if (ctxt->name##Tab == NULL) { \
|
||||
fprintf(xmlXPathDebug, "realloc failed !\n"); \
|
||||
@ -849,10 +849,8 @@ xmlXPathFreeContext(xmlXPathContextPtr ctxt) {
|
||||
if (ctxt->namespaces != NULL)
|
||||
xmlFree(ctxt->namespaces);
|
||||
|
||||
/***********
|
||||
if (ctxt->nodelist != NULL)
|
||||
xmlXPathFreeNodeSet(ctxt->nodelist);
|
||||
***********/
|
||||
#ifdef DEBUG
|
||||
memset(ctxt, 0xB , (size_t) sizeof(xmlXPathContext));
|
||||
#endif
|
||||
@ -2548,7 +2546,7 @@ xmlXPathStringLengthFunction(xmlXPathParserContextPtr ctxt, int nargs) {
|
||||
*/
|
||||
void
|
||||
xmlXPathConcatFunction(xmlXPathParserContextPtr ctxt, int nargs) {
|
||||
xmlXPathObjectPtr cur, new;
|
||||
xmlXPathObjectPtr cur, newobj;
|
||||
xmlChar *tmp;
|
||||
|
||||
if (nargs < 2) {
|
||||
@ -2563,17 +2561,17 @@ xmlXPathConcatFunction(xmlXPathParserContextPtr ctxt, int nargs) {
|
||||
nargs--;
|
||||
|
||||
while (nargs > 0) {
|
||||
new = valuePop(ctxt);
|
||||
if ((new == NULL) || (new->type != XPATH_STRING)) {
|
||||
xmlXPathFreeObject(new);
|
||||
newobj = valuePop(ctxt);
|
||||
if ((newobj == NULL) || (newobj->type != XPATH_STRING)) {
|
||||
xmlXPathFreeObject(newobj);
|
||||
xmlXPathFreeObject(cur);
|
||||
XP_ERROR(XPATH_INVALID_TYPE);
|
||||
}
|
||||
tmp = xmlStrcat(new->stringval, cur->stringval);
|
||||
new->stringval = cur->stringval;
|
||||
tmp = xmlStrcat(newobj->stringval, cur->stringval);
|
||||
newobj->stringval = cur->stringval;
|
||||
cur->stringval = tmp;
|
||||
|
||||
xmlXPathFreeObject(new);
|
||||
xmlXPathFreeObject(newobj);
|
||||
nargs--;
|
||||
}
|
||||
valuePush(ctxt, cur);
|
||||
|
Reference in New Issue
Block a user