diff --git a/ChangeLog b/ChangeLog index 8f19057652..c051e7feb4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Fri Feb 20 19:11:20 2004 Nobuyoshi Nakada + + * lib/ostruct.rb (OpenStruct#initialize_copy): should not share + members. [ruby-dev:22966] + Fri Feb 20 18:59:47 2004 Yukihiro Matsumoto * lib/irb/init.rb (IRB::IRB.parse_opts): add -I option to diff --git a/lib/ostruct.rb b/lib/ostruct.rb index 786bd4de20..b0bb775263 100644 --- a/lib/ostruct.rb +++ b/lib/ostruct.rb @@ -52,6 +52,12 @@ class OpenStruct end end + # Duplicate an OpenStruct object members. + def initialize_copy(orig) + super + @table = @table.dup + end + def method_missing(mid, *args) # :nodoc: mname = mid.id2name len = args.length