From 52325e43b2dbcc322a87d2cdbddc7c64b5ceb60f Mon Sep 17 00:00:00 2001 From: "waterson%netscape.com" Date: Wed, 24 Feb 1999 04:47:19 +0000 Subject: [PATCH] Made default namespaces work. git-svn-id: svn://10.0.0.236/trunk@21700 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/rdf/datasource/src/nsXULContentSink.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/mozilla/rdf/datasource/src/nsXULContentSink.cpp b/mozilla/rdf/datasource/src/nsXULContentSink.cpp index 6ec18e35dc2..e618f744a80 100644 --- a/mozilla/rdf/datasource/src/nsXULContentSink.cpp +++ b/mozilla/rdf/datasource/src/nsXULContentSink.cpp @@ -1417,10 +1417,15 @@ XULContentSinkImpl::PushNameSpacesFrom(const nsIParserNode& aNode) if (0 == offset) { prefix.Truncate(); - PRUnichar next = k.CharAt(sizeof(kNameSpaceDef)-1); - // If the next character is a :, there is a namespace prefix - if (':' == next) { - k.Right(prefix, k.Length()-sizeof(kNameSpaceDef)); + if (k.Length() >= sizeof(kNameSpaceDef)) { + // If the next character is a :, there is a namespace prefix + PRUnichar next = k.CharAt(sizeof(kNameSpaceDef)-1); + if (':' == next) { + k.Right(prefix, k.Length()-sizeof(kNameSpaceDef)); + } + else { + continue; // it's not "xmlns:" + } } // Get the attribute value (the URI for the namespace)