fixed bug while tokenizing ints at end of input stream

git-svn-id: svn://10.0.0.236/trunk@20384 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
peterl%netscape.com
1999-02-11 06:42:02 +00:00
parent b5c996e95b
commit e64bbf889e
3 changed files with 24 additions and 0 deletions

View File

@@ -674,6 +674,7 @@ PRBool nsCSSScanner::ParseNumber(PRInt32& aErrorCode, PRInt32 c,
} else if ('%' == c) {
type = eCSSToken_Percentage;
value = value / 100.0f;
ident.SetLength(0);
} else {
// Put back character that stopped numeric scan
Unread();
@@ -684,6 +685,13 @@ PRBool nsCSSScanner::ParseNumber(PRInt32& aErrorCode, PRInt32 c,
ident.SetLength(0);
}
}
else { // stream ended
if (!gotDot) {
aToken.mInteger = ident.ToInteger(&ec);
aToken.mIntegerValid = PR_TRUE;
}
ident.SetLength(0);
}
aToken.mNumber = value;
aToken.mType = type;
return PR_TRUE;