Permalink
Browse files

Fix XPointer bug.

BUG=125462
AUTHOR=asd@ut.ee
R=cevans@chromium.org
Review URL: https://chromiumcodereview.appspot.com/10344022

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@135174 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information...
1 parent e046ed1 commit 66c1c105a7d1e9ca555b76745a42646d7e46ed3d cevans@chromium.org committed May 3, 2012
Showing with 4 additions and 10 deletions.
  1. +1 −0 third_party/libxml/README.chromium
  2. +3 −10 third_party/libxml/src/xpointer.c
@@ -23,6 +23,7 @@ Modifications:
- Import UTF-8 fix from upstream: http://git.gnome.org/browse/libxml2/commit/?id=0795348aeb86648723bc391e4d02e20631c10bca
- Import XPath fix http://git.gnome.org/browse/libxml2/commit/xpath.c?id=2ddecc23862bab1a9a9e51e097aefc92ec305e28
- Merge clang warning fix http://git.gnome.org/browse/libxml2/commit/?id=aae48e64dfbf2b46b157a4c1857e30645116388f
+- Add a fix for proper escaping of xpointer expressions, commit upstream is pending.
To import a new snapshot of libxml:
@@ -1007,21 +1007,14 @@ xmlXPtrEvalXPtrPart(xmlXPathParserContextPtr ctxt, xmlChar *name) {
NEXT;
break;
}
- *cur++ = CUR;
} else if (CUR == '(') {
level++;
- *cur++ = CUR;
} else if (CUR == '^') {
- NEXT;
- if ((CUR == ')') || (CUR == '(') || (CUR == '^')) {
- *cur++ = CUR;
- } else {
- *cur++ = '^';
- *cur++ = CUR;
+ if ((NXT(1) == ')') || (NXT(1) == '(') || (NXT(1) == '^')) {
+ NEXT;
}
- } else {
- *cur++ = CUR;
}
+ *cur++ = CUR;
NEXT;
}
*cur = 0;

0 comments on commit 66c1c10

Please sign in to comment.