summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Frank <flori@ping.de>2012-03-26 16:27:46 +0200
committerFlorian Frank <flori@ping.de>2012-03-26 16:27:46 +0200
commite5fea468625044323809df453da62773eb6daad7 (patch)
tree49262ed8c6af5184f5e09d6f21eb3af25edbc435
parent519437ab428d67f4b4105e2a94f2f2c1601fdcf5 (diff)
downloadjson-e5fea468625044323809df453da62773eb6daad7.tar.gz
Add a comment mentioning some limitiation
-rw-r--r--ext/json/ext/generator/generator.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/ext/json/ext/generator/generator.c b/ext/json/ext/generator/generator.c
index cfd00b5..e1f2d09 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);