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 | e849cce8a00b70141ad10fbd0e1e2f549767fda7 (patch) | |
tree | f4e6e507e13c08aec986f3b7b6052319cfc2430a /ext/dl/lib/dl | |
parent | f281abc9d11c1a4dfef72090e1b6a3aae3bb2bc5 (diff) | |
download | ruby-e849cce8a00b70141ad10fbd0e1e2f549767fda7.tar.gz |
bugfix.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7873 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/dl/lib/dl')
-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 2f54019294..33f303fe22 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", |