json_error_t source setting
When passing a FILE* or fd to json_loadf/json_loadfd, it would be nice if one could prevent jansson from overriding the jerr->source with "
Suggestion: teach the json_load* function a flag that says "don't override jerr->source", and make jsonp_error_set_source public.
This is also a problem internally: json_load_file sets the source appropriately, but unless the fopen() outright fails, all information about the origin is lost (json_load_file just delegates to json_loadf). For example
json_t *json;
json_error_t jerr;
json = json_load_file(argv[1], 0, &jerr);
if (!json) {
fprintf(stderr, "json error: %s:%d:%d: %s\n",
jerr.source, jerr.line, jerr.column,
jerr.text);
}
gives output such as
json error: <stream>:2:0: string or '}' expected near end of file
json error: y:-1:-1: unable to open y: No such file or directory