1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2026-01-26 21:41:34 +03:00

xmllint: Don't serialize to memory with --memory option

This is only useful for debugging.
This commit is contained in:
Nick Wellnhofer
2025-04-17 19:42:30 +02:00
parent 8dbf298cc5
commit c132829c10

View File

@@ -2394,37 +2394,6 @@ parseAndPrintFile(xmllintState *lint, const char *filename) {
}
} else
#endif
#if HAVE_DECL_MMAP
if (lint->memory) {
xmlChar *result;
int len;
if (lint->encoding != NULL) {
if (lint->format == 1) {
xmlDocDumpFormatMemoryEnc(doc, &result, &len,
lint->encoding, 1);
} else {
xmlDocDumpMemoryEnc(doc, &result, &len,
lint->encoding);
}
} else {
if (lint->format == 1)
xmlDocDumpFormatMemory(doc, &result, &len, 1);
else
xmlDocDumpMemory(doc, &result, &len);
}
if (result == NULL) {
fprintf(errStream, "Failed to save\n");
lint->progresult = XMLLINT_ERR_OUT;
} else {
if (write(1, result, len) == -1) {
fprintf(errStream, "Can't write data\n");
}
xmlFree(result);
}
} else
#endif /* HAVE_DECL_MMAP */
if (lint->compress) {
xmlSaveFile(lint->output ? lint->output : "-", doc);
} else {