ox 2.0.11 → 2.0.12

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of ox might be problematic. Click here for more details.

data/ext/ox/extconf.rb CHANGED
@@ -6,6 +6,7 @@ dir_config(extension_name)
6
6
  parts = RUBY_DESCRIPTION.split(' ')
7
7
  type = parts[0].downcase()
8
8
  type = 'ree' if 'ruby' == type && RUBY_DESCRIPTION.include?('Ruby Enterprise Edition')
9
+ is_windows = RbConfig::CONFIG['host_os'] =~ /(mingw|mswin)/
9
10
  platform = RUBY_PLATFORM
10
11
  version = RUBY_VERSION.split('.')
11
12
  puts ">>>>> Creating Makefile for #{type} version #{RUBY_VERSION} on #{platform} <<<<<"
@@ -28,7 +29,7 @@ dflags = {
28
29
  'HAS_PRIVATE_ENCODING' => ('jruby' == type && '1' == version[0] && '9' == version[1]) ? 1 : 0,
29
30
  'HAS_NANO_TIME' => ('ruby' == type && ('1' == version[0] && '9' == version[1]) || '2' <= version[0]) ? 1 : 0,
30
31
  'HAS_RSTRUCT' => ('ruby' == type || 'ree' == type) ? 1 : 0,
31
- 'HAS_IVAR_HELPERS' => ('ruby' == type && ('1' == version[0] && '9' == version[1]) || '2' <= version[0]) ? 1 : 0,
32
+ 'HAS_IVAR_HELPERS' => ('ruby' == type && !is_windows && (('1' == version[0] && '9' == version[1]) || '2' <= version[0])) ? 1 : 0,
32
33
  'HAS_PROC_WITH_BLOCK' => ('ruby' == type && ('1' == version[0] && '9' == version[1]) || '2' <= version[0]) ? 1 : 0,
33
34
  'HAS_GC_GUARD' => ('jruby' != type && 'rubinius' != type) ? 1 : 0,
34
35
  'HAS_BIGDECIMAL' => ('jruby' != type) ? 1 : 0,
data/ext/ox/sax.c CHANGED
@@ -85,20 +85,6 @@ static Nv hint_try_close(SaxDrive dr, const char *name);
85
85
 
86
86
  VALUE ox_sax_value_class = Qnil;
87
87
 
88
- /* This is only for CentOS 5.4 with Ruby 1.9.3-p0 and for OS X 10.6 and Solaris 10. */
89
- #ifdef NEEDS_STPCPY
90
- char *stpncpy(char *dest, const char *src, size_t n) {
91
- size_t cnt = strlen(src) + 1;
92
-
93
- if (n < cnt) {
94
- cnt = n;
95
- }
96
- strncpy(dest, src, cnt);
97
-
98
- return dest + cnt - 1;
99
- }
100
- #endif
101
-
102
88
  static VALUE protect_parse(VALUE drp) {
103
89
  parse((SaxDrive)drp);
104
90
 
data/ext/ox/sax_buf.c CHANGED
@@ -243,6 +243,19 @@ read_from_fd(Buf buf) {
243
243
  }
244
244
  #endif
245
245
 
246
+ static char*
247
+ ox_stpncpy(char *dest, const char *src, size_t n) {
248
+ size_t cnt = strlen(src) + 1;
249
+
250
+ if (n < cnt) {
251
+ cnt = n;
252
+ }
253
+ strncpy(dest, src, cnt);
254
+
255
+ return dest + cnt - 1;
256
+ }
257
+
258
+
246
259
  static int
247
260
  read_from_str(Buf buf) {
248
261
  size_t max = buf->end - buf->tail - 1;
@@ -253,7 +266,7 @@ read_from_str(Buf buf) {
253
266
  /* done */
254
267
  return -1;
255
268
  }
256
- s = stpncpy(buf->tail, buf->in_str, max);
269
+ s = ox_stpncpy(buf->tail, buf->in_str, max);
257
270
  *s = '\0';
258
271
  cnt = s - buf->tail;
259
272
  buf->in_str += cnt;
data/lib/ox/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
 
2
2
  module Ox
3
3
  # Current version of the module.
4
- VERSION = '2.0.11'
4
+ VERSION = '2.0.12'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ox
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.11
4
+ version: 2.0.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Ohler
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-10-17 00:00:00.000000000 Z
11
+ date: 2013-12-01 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: "A fast XML parser and object serializer that uses only standard C lib.\n
14
14
  \ \nOptimized XML (Ox), as the name implies was written to provide speed