bencode_ext 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.1
1
+ 0.1.2
data/bencode_ext.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{bencode_ext}
8
- s.version = "0.1.1"
8
+ s.version = "0.1.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["naquad"]
12
- s.date = %q{2010-12-24}
12
+ s.date = %q{2011-01-01}
13
13
  s.description = %q{BEncodeExt is implementation of Bencode reader/writer (BitTorent encoding) in C.}
14
14
  s.email = %q{naquad@gmail.com}
15
15
  s.extensions = ["ext/bencode_ext/extconf.rb", "ext/bencode_ext/extconf.rb"]
@@ -66,13 +66,11 @@ static VALUE _decode(char** str, long* len, long rlen){
66
66
  NEXT_CHAR;
67
67
 
68
68
  while(**str != 'e' && *len){
69
- long t = rlen - *len;
69
+ long t = *len;
70
70
  VALUE k = _decode(str, len, rlen);
71
71
 
72
- if(NIL_P(k))
73
- rb_raise(DecodeError, "Unpexpected dictionary end!");
74
- else if(TYPE(k) != T_STRING)
75
- rb_raise(DecodeError, "Dictionary key is not a string at %d!", t);
72
+ if(TYPE(k) != T_STRING)
73
+ rb_raise(DecodeError, "Dictionary key is not a string at %d!", rlen - t);
76
74
 
77
75
  rb_hash_aset(ret, k, _decode(str, len, rlen));
78
76
  }
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 1
8
- - 1
9
- version: 0.1.1
8
+ - 2
9
+ version: 0.1.2
10
10
  platform: ruby
11
11
  authors:
12
12
  - naquad
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-12-24 00:00:00 +02:00
17
+ date: 2011-01-01 00:00:00 +02:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency