diff options
author | ttate <ttate@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-02-03 14:38:31 +0000 |
---|---|---|
committer | ttate <ttate@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-02-03 14:38:31 +0000 |
commit | 90973e2b1f03e7b06cb2f583dcbcae64de8388dd (patch) | |
tree | ba6665139d8a28a04bf6aa144e3b3a4f3595e8b4 /ext | |
parent | 832efbcea08401356f58a85272b0b7358dba91da (diff) | |
download | ruby-90973e2b1f03e7b06cb2f583dcbcae64de8388dd.tar.gz ruby-90973e2b1f03e7b06cb2f583dcbcae64de8388dd.tar.xz ruby-90973e2b1f03e7b06cb2f583dcbcae64de8388dd.zip |
bugfix.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@7873 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext')
-rw-r--r-- | ext/dl/lib/dl/struct.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/dl/lib/dl/struct.rb b/ext/dl/lib/dl/struct.rb index 2f5401929..33f303fe2 100644 --- a/ext/dl/lib/dl/struct.rb +++ b/ext/dl/lib/dl/struct.rb @@ -33,7 +33,7 @@ module DL "def #{name}", " v = @ptr[\"#{name}\"]", " if( @len[\"#{name}\"] )", - " v = v.collect{|x| @dec[\"#{name}\"].call(x) if @dec[\"#{name}\"] }", + " v = v.collect{|x| @dec[\"#{name}\"] ? @dec[\"#{name}\"].call(x) : x }", " else", " v = @dec[\"#{name}\"].call(v) if @dec[\"#{name}\"]", " end", @@ -41,7 +41,7 @@ module DL "end", "def #{name}=(v)", " if( @len[\"#{name}\"] )", - " v = v.collect{|x| @enc[\"#{name}\"].call(x) if @enc[\"#{name}\"] }", + " v = v.collect{|x| @enc[\"#{name}\"] ? @enc[\"#{name}\"].call(x) : x }", " else", " v = @enc[\"#{name}\"].call(v) if @enc[\"#{name}\"]", " end", |