Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

bsonUtils issues, see pull request 12

  • Loading branch information...
commit ed67ce2e96ef4c72a5df0cd353eaa33e775e29cf 1 parent 683b200
Stijn Sanders authored
Showing with 6 additions and 6 deletions.
  1. +6 −6 bsonUtils.pas
12 bsonUtils.pas
View
@@ -449,14 +449,13 @@ procedure JsonIntoBson(const jsonData:WideString; doc:IBSONDocument;
Expect('"','JSON key string not enclosed in double quotes');
GetStringIndexes(k1,k2);
{$ELSE}
- k1:=i;
- while (i<=l) and (jsonData[i]>' ') and
- (jsonData[i]<>':') and (jsonData[i]<>'"') do
+ if SkipWhiteSpace='"' then GetStringIndexes(k1,k2) else
begin
- if jsonData[i]='\' then inc(i);//just skip all to skip any '"'
- inc(i);
+ k1:=i;
+ while (i<=l) and (jsonData[i]>' ') and
+ (jsonData[i]<>':') and (jsonData[i]<>'"') do inc(i);
+ k2:=i;
end;
- k2:=i;
{$ENDIF}
Expect(':','JSON key, value not separated by colon');
end;
@@ -550,6 +549,7 @@ procedure JsonIntoBson(const jsonData:WideString; doc:IBSONDocument;
if char(jsonData[i]) in ['.','e','E'] then
begin
//float
+ inc(i);
while (i<=l) and (char(jsonData[i]) in
['0'..'9','-','+','e','E']) do inc(i);
//try except EConvertError?
Please sign in to comment.
Something went wrong with that request. Please try again.