1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-10-21 14:53:44 +03:00

parser: Remove unnecessary dict checks when freeing strings

The following strings are never allocated from a dict:

- xmlParserCtxt.version
- xmlParserCtxt.encoding
- xmlParserCtxt.extSubURI
- xmlParserCtxt.extSubSystem
- xmlDoc.version
- xmlDoc.encoding
- xmlDoc.URL
- xmlDTD.ExternalID
- xmlDTD.SystemID
- xmlID.value

Also make the struct members point to non-const chars to avoid casts
when freeing.
This commit is contained in:
Nick Wellnhofer
2025-06-22 20:12:48 +02:00
parent 607708b35f
commit 7c91385040
10 changed files with 59 additions and 68 deletions

View File

@@ -276,13 +276,13 @@ struct _xmlParserCtxt {
*
* the XML version string
*/
const xmlChar *version;
xmlChar *version;
/**
* @deprecated Use xmlCtxtGetDeclaredEncoding()
*
* the declared encoding, if any
*/
const xmlChar *encoding;
xmlChar *encoding;
/**
* @deprecated Use xmlCtxtGetStandalone()
*