From 63dc602a12e24e1e7f6a70a7f8df031e52ca7e7b Mon Sep 17 00:00:00 2001 From: Rhodri James Date: Tue, 20 Jun 2017 13:48:40 +0100 Subject: [PATCH] Comment change: exclude unreachable case in prolog1 --- expat/lib/xmlrole.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/expat/lib/xmlrole.c b/expat/lib/xmlrole.c index a7c56302..18d7a51a 100644 --- a/expat/lib/xmlrole.c +++ b/expat/lib/xmlrole.c @@ -170,7 +170,14 @@ prolog1(PROLOG_STATE *state, case XML_TOK_COMMENT: return XML_ROLE_COMMENT; case XML_TOK_BOM: - return XML_ROLE_NONE; + /* This case can never arise. To reach this role function, the + * parse must have passed through prolog0 and therefore have had + * some form of input, even if only a space. At that point, a + * byte order mark is no longer a valid character (though + * technically it should be interpreted as a non-breaking space), + * so will be rejected by the tokenizing stages. + */ + return XML_ROLE_NONE; /* LCOV_EXCL_LINE */ case XML_TOK_DECL_OPEN: if (!XmlNameMatchesAscii(enc, ptr + 2 * MIN_BYTES_PER_CHAR(enc),