зеркало из https://github.com/mozilla/pjs.git
don't extract characters from empty strings
This commit is contained in:
Родитель
18a5bb0dd0
Коммит
f92e1fb30a
|
@ -4863,20 +4863,22 @@ nsXULTemplateBuilder::BuildContentFromTemplate(nsIContent *aTemplateNode,
|
|||
nsAutoString uri;
|
||||
tmplKid->GetAttribute(kNameSpaceID_None, nsXULAtoms::uri, uri);
|
||||
|
||||
if (aMatch->mRule && uri[0] == PRUnichar('?')) {
|
||||
isResourceElement = PR_TRUE;
|
||||
isUnique = PR_FALSE;
|
||||
if ( !uri.IsEmpty() ) {
|
||||
if (aMatch->mRule && uri[0] == PRUnichar('?')) {
|
||||
isResourceElement = PR_TRUE;
|
||||
isUnique = PR_FALSE;
|
||||
|
||||
// XXXwaterson hack! refactor me please
|
||||
Value member;
|
||||
aMatch->mAssignments.GetAssignmentFor(aMatch->mRule->GetMemberVariable(), &member);
|
||||
aChild = VALUE_TO_IRDFRESOURCE(member);
|
||||
}
|
||||
else if (uri.EqualsWithConversion("...") || uri.EqualsWithConversion("rdf:*")) {
|
||||
// If we -are- the resource element, then we are no
|
||||
// matter unique.
|
||||
isResourceElement = PR_TRUE;
|
||||
isUnique = PR_FALSE;
|
||||
// XXXwaterson hack! refactor me please
|
||||
Value member;
|
||||
aMatch->mAssignments.GetAssignmentFor(aMatch->mRule->GetMemberVariable(), &member);
|
||||
aChild = VALUE_TO_IRDFRESOURCE(member);
|
||||
}
|
||||
else if (uri.EqualsWithConversion("...") || uri.EqualsWithConversion("rdf:*")) {
|
||||
// If we -are- the resource element, then we are no
|
||||
// matter unique.
|
||||
isResourceElement = PR_TRUE;
|
||||
isUnique = PR_FALSE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -6994,7 +6996,7 @@ nsXULTemplateBuilder::CompileExtendedRule(nsIContent* aRuleElement,
|
|||
nsAutoString uri;
|
||||
next->GetAttribute(kNameSpaceID_None, nsXULAtoms::uri, uri);
|
||||
|
||||
if (uri[0] == PRUnichar('?')) {
|
||||
if (!uri.IsEmpty() && uri[0] == PRUnichar('?')) {
|
||||
// Found it.
|
||||
mMemberSymbol = uri;
|
||||
rule->AddSymbol(uri, mMemberVar);
|
||||
|
|
|
@ -2554,9 +2554,13 @@ cookie_Load() {
|
|||
*/
|
||||
while (cookie_GetLine(strm,buffer) != -1){
|
||||
added_to_list = PR_FALSE;
|
||||
if (buffer.CharAt(0) == '#' || buffer.CharAt(0) == CR ||
|
||||
buffer.CharAt(0) == LF || buffer.CharAt(0) == 0) {
|
||||
continue;
|
||||
|
||||
if ( !buffer.IsEmpty() ) {
|
||||
PRUnichar firstChar = buffer.CharAt(0);
|
||||
if (firstChar == '#' || firstChar == CR ||
|
||||
firstChar == LF || firstChar == 0) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
int hostIndex, isDomainIndex, pathIndex, xxxIndex, expiresIndex, nameIndex, cookieIndex;
|
||||
hostIndex = 0;
|
||||
|
|
|
@ -4863,20 +4863,22 @@ nsXULTemplateBuilder::BuildContentFromTemplate(nsIContent *aTemplateNode,
|
|||
nsAutoString uri;
|
||||
tmplKid->GetAttribute(kNameSpaceID_None, nsXULAtoms::uri, uri);
|
||||
|
||||
if (aMatch->mRule && uri[0] == PRUnichar('?')) {
|
||||
isResourceElement = PR_TRUE;
|
||||
isUnique = PR_FALSE;
|
||||
if ( !uri.IsEmpty() ) {
|
||||
if (aMatch->mRule && uri[0] == PRUnichar('?')) {
|
||||
isResourceElement = PR_TRUE;
|
||||
isUnique = PR_FALSE;
|
||||
|
||||
// XXXwaterson hack! refactor me please
|
||||
Value member;
|
||||
aMatch->mAssignments.GetAssignmentFor(aMatch->mRule->GetMemberVariable(), &member);
|
||||
aChild = VALUE_TO_IRDFRESOURCE(member);
|
||||
}
|
||||
else if (uri.EqualsWithConversion("...") || uri.EqualsWithConversion("rdf:*")) {
|
||||
// If we -are- the resource element, then we are no
|
||||
// matter unique.
|
||||
isResourceElement = PR_TRUE;
|
||||
isUnique = PR_FALSE;
|
||||
// XXXwaterson hack! refactor me please
|
||||
Value member;
|
||||
aMatch->mAssignments.GetAssignmentFor(aMatch->mRule->GetMemberVariable(), &member);
|
||||
aChild = VALUE_TO_IRDFRESOURCE(member);
|
||||
}
|
||||
else if (uri.EqualsWithConversion("...") || uri.EqualsWithConversion("rdf:*")) {
|
||||
// If we -are- the resource element, then we are no
|
||||
// matter unique.
|
||||
isResourceElement = PR_TRUE;
|
||||
isUnique = PR_FALSE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -6994,7 +6996,7 @@ nsXULTemplateBuilder::CompileExtendedRule(nsIContent* aRuleElement,
|
|||
nsAutoString uri;
|
||||
next->GetAttribute(kNameSpaceID_None, nsXULAtoms::uri, uri);
|
||||
|
||||
if (uri[0] == PRUnichar('?')) {
|
||||
if (!uri.IsEmpty() && uri[0] == PRUnichar('?')) {
|
||||
// Found it.
|
||||
mMemberSymbol = uri;
|
||||
rule->AddSymbol(uri, mMemberVar);
|
||||
|
|
Загрузка…
Ссылка в новой задаче