bencode_ext 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/VERSION +1 -1
 - data/bencode_ext.gemspec +2 -2
 - data/ext/bencode_ext/bencode.c +3 -5
 - metadata +3 -3
 
    
        data/VERSION
    CHANGED
    
    | 
         @@ -1 +1 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            0.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. 
     | 
| 
      
 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{ 
     | 
| 
      
 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"]
         
     | 
    
        data/ext/bencode_ext/bencode.c
    CHANGED
    
    | 
         @@ -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 =  
     | 
| 
      
 69 
     | 
    
         
            +
                    long t = *len;
         
     | 
| 
       70 
70 
     | 
    
         
             
                    VALUE k = _decode(str, len, rlen);
         
     | 
| 
       71 
71 
     | 
    
         | 
| 
       72 
     | 
    
         
            -
                    if( 
     | 
| 
       73 
     | 
    
         
            -
                      rb_raise(DecodeError, " 
     | 
| 
       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 
     | 
    
         
            -
              -  
     | 
| 
       9 
     | 
    
         
            -
              version: 0.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:  
     | 
| 
      
 17 
     | 
    
         
            +
            date: 2011-01-01 00:00:00 +02:00
         
     | 
| 
       18 
18 
     | 
    
         
             
            default_executable: 
         
     | 
| 
       19 
19 
     | 
    
         
             
            dependencies: 
         
     | 
| 
       20 
20 
     | 
    
         
             
            - !ruby/object:Gem::Dependency 
         
     |