oj 2.9.1 → 2.9.2
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of oj might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/README.md +4 -0
- data/ext/oj/dump.c +1 -1
- data/ext/oj/oj.c +3 -3
- data/ext/oj/parse.c +2 -0
- data/ext/oj/saj.c +2 -3
- data/ext/oj/scp.c +2 -3
- data/ext/oj/sparse.c +2 -1
- data/lib/oj/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b407855f298c79a1a5aa4533773acb82bfbf8506
|
4
|
+
data.tar.gz: 7f4c484232b2fd3af6c124e7e773b8a11ce91ea5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 939e9faafb18e2012621e4aad5fda45c2f2e832139c150d7d01f87fc2d891c0cc7df362d9b9aa1f9cf746efa4db7524aeea8626f91b6379eab0c07a374b27ff6
|
7
|
+
data.tar.gz: 68da1860ac19fc5304f0c4fd9ef3e9afe8677c3715765a3039f82d36c9678e02c41701bf2f27302e847cf9bff6adbdb64901318cbfa78bd7fd3132a5ef3a8ef3
|
data/README.md
CHANGED
@@ -26,6 +26,10 @@ Follow [@peterohler on Twitter](http://twitter.com/#!/peterohler) for announceme
|
|
26
26
|
|
27
27
|
[![Build Status](https://secure.travis-ci.org/ohler55/oj.png?branch=master)](http://travis-ci.org/ohler55/oj)
|
28
28
|
|
29
|
+
### Current Release 2.9.2
|
30
|
+
|
31
|
+
- Fixed link error with Windows.
|
32
|
+
|
29
33
|
### Current Release 2.9.1
|
30
34
|
|
31
35
|
- Fixed mimic load when given a block to evalate. It conflicted with the new
|
data/ext/oj/dump.c
CHANGED
data/ext/oj/oj.c
CHANGED
@@ -1483,13 +1483,13 @@ mimic_walk(VALUE key, VALUE obj, VALUE proc) {
|
|
1483
1483
|
static VALUE
|
1484
1484
|
mimic_load(int argc, VALUE *argv, VALUE self) {
|
1485
1485
|
struct _ParseInfo pi;
|
1486
|
+
VALUE obj;
|
1487
|
+
VALUE p = Qnil;
|
1486
1488
|
|
1487
1489
|
pi.options = oj_default_options;
|
1488
1490
|
oj_set_compat_callbacks(&pi);
|
1489
1491
|
|
1490
|
-
|
1491
|
-
VALUE p = Qnil;
|
1492
|
-
|
1492
|
+
obj = oj_pi_parse(argc, argv, &pi, 0, 0, 0);
|
1493
1493
|
if (2 <= argc) {
|
1494
1494
|
p = argv[1];
|
1495
1495
|
}
|
data/ext/oj/parse.c
CHANGED
@@ -770,7 +770,9 @@ oj_pi_parse(int argc, VALUE *argv, ParseInfo pi, char *json, size_t len, int yie
|
|
770
770
|
} else {
|
771
771
|
VALUE clas = rb_obj_class(input);
|
772
772
|
volatile VALUE s;
|
773
|
+
#if !IS_WINDOWS
|
773
774
|
int fd;
|
775
|
+
#endif
|
774
776
|
|
775
777
|
if (oj_stringio_class == clas) {
|
776
778
|
s = rb_funcall2(input, oj_string_id, 0, 0);
|
data/ext/oj/saj.c
CHANGED
@@ -716,16 +716,16 @@ oj_saj_parse(int argc, VALUE *argv, VALUE self) {
|
|
716
716
|
} else {
|
717
717
|
VALUE clas = rb_obj_class(input);
|
718
718
|
volatile VALUE s;
|
719
|
+
#if !IS_WINDOWS
|
719
720
|
int fd;
|
721
|
+
#endif
|
720
722
|
|
721
723
|
if (oj_stringio_class == clas) {
|
722
724
|
s = rb_funcall2(input, oj_string_id, 0, 0);
|
723
725
|
len = RSTRING_LEN(s) + 1;
|
724
726
|
json = ALLOC_N(char, len);
|
725
727
|
strcpy(json, rb_string_value_cstr((VALUE*)&s));
|
726
|
-
#ifndef JRUBY_RUBY
|
727
728
|
#if !IS_WINDOWS
|
728
|
-
// JRuby gets confused with what is the real fileno.
|
729
729
|
} else if (rb_respond_to(input, oj_fileno_id) &&
|
730
730
|
Qnil != (s = rb_funcall(input, oj_fileno_id, 0)) &&
|
731
731
|
0 != (fd = FIX2INT(s))) {
|
@@ -738,7 +738,6 @@ oj_saj_parse(int argc, VALUE *argv, VALUE self) {
|
|
738
738
|
rb_raise(rb_eIOError, "failed to read from IO Object.");
|
739
739
|
}
|
740
740
|
json[len] = '\0';
|
741
|
-
#endif
|
742
741
|
#endif
|
743
742
|
} else if (rb_respond_to(input, oj_read_id)) {
|
744
743
|
s = rb_funcall2(input, oj_read_id, 0, 0);
|
data/ext/oj/scp.c
CHANGED
@@ -260,12 +260,12 @@ oj_sc_parse(int argc, VALUE *argv, VALUE self) {
|
|
260
260
|
} else {
|
261
261
|
VALUE clas = rb_obj_class(input);
|
262
262
|
volatile VALUE s;
|
263
|
+
#if !IS_WINDOWS
|
263
264
|
int fd;
|
264
|
-
|
265
|
+
#endif
|
265
266
|
if (oj_stringio_class == clas) {
|
266
267
|
s = rb_funcall2(input, oj_string_id, 0, 0);
|
267
268
|
pi.json = StringValuePtr(input);
|
268
|
-
#ifndef JRUBY_RUBY
|
269
269
|
#if !IS_WINDOWS
|
270
270
|
// JRuby gets confused with what is the real fileno.
|
271
271
|
} else if (rb_respond_to(input, oj_fileno_id) &&
|
@@ -284,7 +284,6 @@ oj_sc_parse(int argc, VALUE *argv, VALUE self) {
|
|
284
284
|
rb_raise(rb_eIOError, "failed to read from IO Object.");
|
285
285
|
}
|
286
286
|
((char*)pi.json)[len] = '\0';
|
287
|
-
#endif
|
288
287
|
#endif
|
289
288
|
} else if (rb_respond_to(input, oj_read_id)) {
|
290
289
|
s = rb_funcall2(input, oj_read_id, 0, 0);
|
data/ext/oj/sparse.c
CHANGED
@@ -37,6 +37,7 @@
|
|
37
37
|
#include "oj.h"
|
38
38
|
#include "parse.h"
|
39
39
|
#include "buf.h"
|
40
|
+
#include "hash.h" // for oj_strndup()
|
40
41
|
#include "val_stack.h"
|
41
42
|
|
42
43
|
// Workaround in case INFINITY is not defined in math.h or if the OS is CentOS
|
@@ -357,7 +358,7 @@ read_str(ParseInfo pi) {
|
|
357
358
|
case NEXT_HASH_KEY:
|
358
359
|
parent->klen = pi->rd.tail - pi->rd.str - 1;
|
359
360
|
if (sizeof(parent->karray) <= parent->klen) {
|
360
|
-
parent->key =
|
361
|
+
parent->key = oj_strndup(pi->rd.str, parent->klen);
|
361
362
|
parent->kalloc = 1;
|
362
363
|
} else {
|
363
364
|
memcpy(parent->karray, pi->rd.str, parent->klen);
|
data/lib/oj/version.rb
CHANGED