don't extract characters from empty strings

This commit is contained in:
scc%mozilla.org 2000-06-11 08:19:41 +00:00
Родитель 18a5bb0dd0
Коммит f92e1fb30a
3 изменённых файлов: 39 добавлений и 31 удалений

Просмотреть файл

@ -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);