aboutsummaryrefslogtreecommitdiffstats
path: root/parser.c
diff options
context:
space:
mode:
authorJuergen Keil <jrgn.keil@googlemail.com>2014-08-07 16:28:09 +0800
committerDaniel Veillard <veillard@redhat.com>2014-08-07 16:28:09 +0800
commit5d4310af453a2220851b7063ebf165ce8b47494c (patch)
treebf9f2a834f8809b16840b85afa99c360ae54b45e /parser.c
parentd201e71ed0df1dce7aca232f81a1c3e2eee8be73 (diff)
downloadandroid_external_libxml2-5d4310af453a2220851b7063ebf165ce8b47494c.tar.gz
android_external_libxml2-5d4310af453a2220851b7063ebf165ce8b47494c.tar.bz2
android_external_libxml2-5d4310af453a2220851b7063ebf165ce8b47494c.zip
wrong error column in structured error when skipping whitespace in xml decl
For https://bugzilla.gnome.org/show_bug.cgi?id=734276 libxml2 reports wrong error column numbers (field int2 in xmlError) in structured error handler, after an XML declaration containing whitespace. Example XML: <?xml version="1.0" encoding="UTF-8" ?><root>&</root> <!-- 1 2 3 4 5 6 123456789012345678901234567890123456789012345678901234567890 --> Expected location of the error would be line 1, column 53. The actual location of the error is line 1, column 44: $ ./xmlparse colbug1.xml colbug1.xml:1:44: xmlParseEntityRef: no name
Diffstat (limited to 'parser.c')
-rw-r--r--parser.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/parser.c b/parser.c
index 46fb1e77..fdb4514c 100644
--- a/parser.c
+++ b/parser.c
@@ -2109,6 +2109,8 @@ xmlSkipBlankChars(xmlParserCtxtPtr ctxt) {
while (IS_BLANK_CH(*cur)) {
if (*cur == '\n') {
ctxt->input->line++; ctxt->input->col = 1;
+ } else {
+ ctxt->input->col++;
}
cur++;
res++;