Sayre-Tnunu / vba-json

Automatically exported from code.google.com/p/vba-json
0 stars 0 forks source link

Unable to parse strings containing colons - Infinite loop #14

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. In the parse_test4 subroutine, change any of the ""test"" elems to ""te:st""
2. Run the subroutine

What is the expected output? What do you see instead?
The expected output should be the normal json output from the test. Instead, 
Excel freezes - because it is really good at detecting redundancies so it just 
loops them as fast as possible till windows asks if you want to crash the 
instance and restart.

What version of the product are you using? On what operating system?
The latest version - with Microsoft Office 2007 running on Windows 7

Please provide any additional information below.

Great parser. It's worked really well so far. I'll fix this bug in my instance, 
but I'm not sure if I should add my fix here or not. I'm pretty sure it won't 
be elegant :)

Original issue reported on code.google.com by fadeyi.f...@gmail.com on 2 Jun 2012 at 4:19

GoogleCodeExporter commented 9 years ago
I fixed this by modifying the case for ":" in the method parsekey as follows:
        Case ":"
            index = index + 1
            If Not dquote And Not squote Then
                Exit Do
            Else
                parseKey = parseKey & char
            End If

Original comment by fadeyi.f...@gmail.com on 2 Jun 2012 at 4:26