Skip to content

JSON writer produces output that JSON parser fails to read #42

@kdudka

Description

@kdudka

This happens mainly with csgrep --embed-context ... when it reads some garbage from source files (e.g. from qt3d-everywhere-src-5.15.3/src/3rdparty/assimp/code/FBXMaterial.cpp:326 from qt5-qt3d-5.15.3-1.el8). We should fix --embed-context to filter out the garbage, as well as make the JSON reader accept whatever the JSON writer produces.

Minimal example:

$ echo $'\xb4' > x.c && echo 'x.c:1: warning: msg' | csgrep --mode=json -U1 | csgrep
-:19: error: invalid code sequence

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions