summaryrefslogtreecommitdiff
path: root/ext/dl/lib
diff options
context:
space:
mode:
authorttate <ttate@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-02-03 14:38:31 +0000
committerttate <ttate@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-02-03 14:38:31 +0000
commite849cce8a00b70141ad10fbd0e1e2f549767fda7 (patch)
treef4e6e507e13c08aec986f3b7b6052319cfc2430a /ext/dl/lib
parentf281abc9d11c1a4dfef72090e1b6a3aae3bb2bc5 (diff)
bugfix.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7873 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/dl/lib')
-rw-r--r--ext/dl/lib/dl/struct.rb4
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",