1
0
Fork 0
forked from fun/fun

Fixed the code style in *.c files to two spaces indentation and add a linter named funstx to Fun. (0.39.0)

This commit is contained in:
Johannes Findeisen 2026-03-18 20:52:00 +01:00
commit 03b2532474
237 changed files with 17550 additions and 13911 deletions

View file

@ -12,18 +12,25 @@
/* OP_XML_TEXT: pops node handle; pushes string (concatenate text node children) */
case OP_XML_TEXT: {
#ifdef FUN_WITH_XML2
Value vh = pop_value(vm);
int h = (vh.type == VAL_INT) ? (int)vh.i : 0;
xmlNodePtr n = xml_node_get(h);
free_value(vh);
if (!n) { push_value(vm, make_string("")); break; }
xmlChar *content = xmlNodeGetContent(n);
if (!content) { push_value(vm, make_string("")); break; }
push_value(vm, make_string((const char*)content));
xmlFree(content);
#else
Value drop = pop_value(vm); free_value(drop);
Value vh = pop_value(vm);
int h = (vh.type == VAL_INT) ? (int)vh.i : 0;
xmlNodePtr n = xml_node_get(h);
free_value(vh);
if (!n) {
push_value(vm, make_string(""));
#endif
break;
}
xmlChar *content = xmlNodeGetContent(n);
if (!content) {
push_value(vm, make_string(""));
break;
}
push_value(vm, make_string((const char *)content));
xmlFree(content);
#else
Value drop = pop_value(vm);
free_value(drop);
push_value(vm, make_string(""));
#endif
break;
}