Roll back part of the change for Issue #256 since it causes a regression for

some applications and the XML 1.0 specification only requires an XML file to
start with '<' (Issue #259)
This commit is contained in:
Michael R Sweet 2019-07-08 14:15:19 -04:00
parent 03ed2dd9ce
commit e2f7978b15
No known key found for this signature in database
GPG Key ID: 999559A027815955
3 changed files with 11 additions and 16 deletions

View File

@ -1,7 +1,7 @@
# Changes in Mini-XML 3.1
- The `mxmlLoad*` functions now print an error when the XML does not start with
`<?xml ... ?>` and no parent node is supplied (Issue #256)
`<` and no parent node is supplied (Issue #256, Issue #259)
- Fixed an issue with "make install" trying to install old files (Issue #257)
- Fixed some DSO installation issues on Linux.

View File

@ -1418,11 +1418,13 @@ mxml_load_data(
if ((ch = (*getc_cb)(p, &encoding)) == EOF)
{
free(buffer);
return (NULL);
}
else if (ch != '<' && !top)
{
mxml_error("XML does not start with '<?xml' (saw '%c').", ch);
free(buffer);
mxml_error("XML does not start with '<' (saw '%c').", ch);
return (NULL);
}
@ -1585,12 +1587,7 @@ mxml_load_data(
*bufptr = '\0';
if (!top && !parent && buffer[0] != '?')
{
mxml_error("XML does not start with '<?xml' (saw '<%s').", buffer);
return (NULL);
}
else if (!strcmp(buffer, "!--"))
if (!strcmp(buffer, "!--"))
{
/*
* Gather rest of comment...
@ -1773,12 +1770,7 @@ mxml_load_data(
*bufptr = '\0';
if (!top && !parent && strncmp(buffer, "?xml ", 5))
{
mxml_error("XML does not start with '<?xml' (saw '<%s>').", buffer);
return (NULL);
}
else if (!parent && first)
if (!parent && first)
{
/*
* There can only be one root element!

View File

@ -228,7 +228,7 @@
272CFFFD1E8C6664007EBCAC /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 1010;
LastUpgradeCheck = 1020;
ORGANIZATIONNAME = "Michael R Sweet";
TargetAttributes = {
272C00041E8C6664007EBCAC = {
@ -250,10 +250,11 @@
};
buildConfigurationList = 272C00001E8C6664007EBCAC /* Build configuration list for PBXProject "mxml" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
en,
Base,
);
mainGroup = 272CFFFC1E8C6664007EBCAC;
productRefGroup = 272C00061E8C6664007EBCAC /* Products */;
@ -318,6 +319,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_ANALYZER_SECURITY_FLOATLOOPCOUNTER = YES;
@ -380,6 +382,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_ANALYZER_SECURITY_FLOATLOOPCOUNTER = YES;