Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3)

Unified Diff: third_party/libxslt/libxslt/variables.c

Issue 1848793005: Roll libxslt to 891681e3e948f31732229f53cb6db7215f740fc7 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/libxslt/libxslt/transform.c ('k') | third_party/libxslt/libxslt/win32config.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/libxslt/libxslt/variables.c
diff --git a/third_party/libxslt/libxslt/variables.c b/third_party/libxslt/libxslt/variables.c
index 3224116a13744d1600602be2b54414199d70f307..345123d6ac144b1e15e0cfb60a21373e0a29aa95 100644
--- a/third_party/libxslt/libxslt/variables.c
+++ b/third_party/libxslt/libxslt/variables.c
@@ -1445,21 +1445,35 @@ xsltProcessUserParamInternal(xsltTransformContextPtr ctxt,
/*
* Name lookup
*/
-
- name = xsltSplitQName(ctxt->dict, name, &prefix);
href = NULL;
- if (prefix != NULL) {
- xmlNsPtr ns;
- ns = xmlSearchNs(style->doc, xmlDocGetRootElement(style->doc),
- prefix);
- if (ns == NULL) {
- xsltTransformError(ctxt, style, NULL,
- "user param : no namespace bound to prefix %s\n", prefix);
- href = NULL;
- } else {
- href = ns->href;
- }
+ if (name[0] == '{') {
+ int len = 0;
+
+ while ((name[len] != 0) && (name[len] != '}')) len++;
+ if (name[len] == 0) {
+ xsltTransformError(ctxt, style, NULL,
+ "user param : malformed parameter name : %s\n", name);
+ } else {
+ href = xmlDictLookup(ctxt->dict, &name[1], len-1);
+ name = xmlDictLookup(ctxt->dict, &name[len + 1], -1);
+ }
+ }
+ else {
+ name = xsltSplitQName(ctxt->dict, name, &prefix);
+ if (prefix != NULL) {
+ xmlNsPtr ns;
+
+ ns = xmlSearchNs(style->doc, xmlDocGetRootElement(style->doc),
+ prefix);
+ if (ns == NULL) {
+ xsltTransformError(ctxt, style, NULL,
+ "user param : no namespace bound to prefix %s\n", prefix);
+ href = NULL;
+ } else {
+ href = ns->href;
+ }
+ }
}
if (name == NULL)
« no previous file with comments | « third_party/libxslt/libxslt/transform.c ('k') | third_party/libxslt/libxslt/win32config.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698