From fc740f59c0ebd3fb2d71fa98a57dce6002c16af0 Mon Sep 17 00:00:00 2001 From: Florian Frank Date: Mon, 26 Mar 2012 16:27:46 +0200 Subject: Add a comment mentioning some limitiation --- ext/json/ext/generator/generator.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ext/json/ext/generator/generator.c b/ext/json/ext/generator/generator.c index 279c49d..b1babb1 100644 --- a/ext/json/ext/generator/generator.c +++ b/ext/json/ext/generator/generator.c @@ -852,6 +852,11 @@ static VALUE cState_partial_generate(VALUE self, VALUE obj) return fbuffer_to_s(buffer); } +/* + * This function returns true if string is either a JSON array or JSON object. + * It might suffer from false positives, e. g. syntactically incorrect JSON in + * the string or certain UTF-8 characters on the right hand side. + */ static int isArrayOrObject(VALUE string) { long string_len = RSTRING_LEN(string); -- cgit v1.2.1