aboutsummaryrefslogtreecommitdiffhomepage
path: root/json.c
Commit message (Collapse)AuthorAge
* json_quote_chararray: Always return a newly talloced arrayGravatar Anthony2010-04-20
| | | | | | | | | | | The special case for len==0 was wrong---the normal code path is to talloc to get a newly allocated, editable string, that might be talloc_free'd later. It makes more sense just to let the len==0 behaviour fall through into the normal case code. Reviewed-by: Carl Worth <cworth@cworth.org> This results in the same value being returned, but with the proper memory handling.
* json: Avoid calling strlen(NULL)Gravatar David Edmondson2010-04-20
| | | | | MIME parts may have no filename, which previously resulted in calling strlen(NULL).
* Fix json_quote_str to handle non-ASCII charactersGravatar Gregor Hoffleit2010-04-13
| | | | | | | | | | | | | The current code in json_quote_str() only accepts strict printable ASCII code points (i.e. 32-127), all other code points are dropped from the JSON output. The code is attempting to drop only non-printable ASCII characters, but doing a signed comparison of the byte value is also dropping characters with values >= 128. This patch uses an unsigned comparison to accept code points 32-255. Reviewed-by: Carl Worth <cworth@cworth.org> (with some additional details for commit message).
* notmuch: Correctly terminate text/* parts in JSON outputGravatar David Edmondson2010-04-05
| | | | | | Text parts returned by `g_mime_stream_mem_get_byte_array()' are not NULL terminated strings - add `json_quote_chararray()' to handle them correctly.
* json: Add copy of MIT license text from cJSONGravatar Carl Worth2010-02-23
| | | | | | When we incorporate external code, we should include its license, (particularly when one of the terms of the license is to include it in copies).
* Add an "--format=(json|text)" command-line option to both notmuch-search and ↵Gravatar Scott Robinson2010-02-23
notmuch-show. In the case of notmuch-show, "--format=json" also implies "--entire-thread" as the thread structure is implicit in the emitted document tree. As a coincidence to the implementation, multipart message ID numbers are now incremented with each part printed. This changes the previous semantics, which were unclear and not necessary related to the actual ordering of the message parts.