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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 89fa4d9b461087f8729149310d3ff78f6c93208f
4
- data.tar.gz: ae041dd8632861dbb9a456fe28212ee33828b866
3
+ metadata.gz: b407855f298c79a1a5aa4533773acb82bfbf8506
4
+ data.tar.gz: 7f4c484232b2fd3af6c124e7e773b8a11ce91ea5
5
5
  SHA512:
6
- metadata.gz: a4c73cfee1fad82bb875f6c0e57695ae5ed7c0de7ea573e46296624ae98d8cb4ea05d9b24c8847f0dd99b12ccbb98763a333f1c3a6e0e1b60b00f49d8ccb7c0c
7
- data.tar.gz: 82419fd8c95688ede5884b41f37a67e04236eb666660407487076dad1f492cfef964ed819d4976eabd6d22b35eb0d3dd25fdc0b96a87d6a4d1b1ba71770c1068
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
@@ -1864,8 +1864,8 @@ oj_write_obj_to_stream(VALUE obj, VALUE stream, Options copts) {
1864
1864
  struct _Out out;
1865
1865
  ssize_t size;
1866
1866
  VALUE clas = rb_obj_class(stream);
1867
- int fd;
1868
1867
  #if !IS_WINDOWS
1868
+ int fd;
1869
1869
  VALUE s;
1870
1870
  #endif
1871
1871
 
@@ -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
- VALUE obj = oj_pi_parse(argc, argv, &pi, 0, 0, 0);
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
  }
@@ -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);
@@ -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);
@@ -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);
@@ -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 = strndup(pi->rd.str, parent->klen);
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);
@@ -1,5 +1,5 @@
1
1
 
2
2
  module Oj
3
3
  # Current version of the module.
4
- VERSION = '2.9.1'
4
+ VERSION = '2.9.2'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: oj
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.9.1
4
+ version: 2.9.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Ohler