* The fix in r15551 was not entirely correct. Must handle the case when string ends with a single whitespace.

git-svn-id: trunk@15570 -
This commit is contained in:
sergei 2010-07-14 14:35:13 +00:00
parent a872d84f72
commit 1a50f3ed26
2 changed files with 11 additions and 8 deletions

View File

@ -325,11 +325,12 @@ var
DoIncJ: Boolean;
begin
Attr := nil;
i := 1;
while (i <= Length(s)) and not IsXMLWhitespace(s[i]) do
Inc(i);
i := 0;
repeat
Inc(i)
until (i > Length(s)) or IsXMLWhitespace(s[i]);
if i = Length(s) then
if i > Length(s) then
Result := s
else
begin

View File

@ -272,10 +272,12 @@ procedure TSAXXMLReader.EnterNewScannerContext(NewContext: TXMLScannerContext);
DoIncJ: Boolean;
begin
Attr := nil;
i := 1;
while (i <= Length(s)) and not (s[i] in WhitespaceChars) do
Inc(i);
if i = Length(s) then
i := 0;
repeat
Inc(i)
until (i > Length(s)) or (s[i] in WhitespaceChars);
if i > Length(s) then
Result := LowerCase(s)
else
begin