Old-Man-Programmer / tree

Tree for Unix/LInux
GNU General Public License v2.0
151 stars 29 forks source link

Fix breaking json error #4

Closed NashJames closed 2 years ago

NashJames commented 2 years ago

Errors in JSON representation of the tree break without a starting comma.

Right now, it creates an additional object which is not ideal, the comma just prevents it breaking. I tried fixing it properly but I don't actually know the C language. I was mostly guessing.

The original intention was this, which would be much better. https://github.com/Old-Man-Programmer/tree/blob/77ebb0aa85854ff419891c008d82c9a74a382581/json.c#L38