diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-05-20 12:17:14 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-05-20 12:17:14 +0000 |
commit | 27c13f82b9312f984789bb5a0426328272b3b873 (patch) | |
tree | b217891a9feda986f3e1c0048665dfaacf3e09f9 /ext/win32ole | |
parent | 2eb1ec25d15e2b170681b16574b6974282770e76 (diff) |
win32ole.c: share the content
* ext/win32ole/win32ole.c (fole_missing): make substring or dup to
share the content if possible.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55081 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/win32ole')
-rw-r--r-- | ext/win32ole/win32ole.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/win32ole/win32ole.c b/ext/win32ole/win32ole.c index 31ed28ad44..4dcd22e6f0 100644 --- a/ext/win32ole/win32ole.c +++ b/ext/win32ole/win32ole.c @@ -3303,12 +3303,12 @@ fole_missing(int argc, VALUE *argv, VALUE self) n = RSTRING_LEN(mid); if(mname[n-1] == '=') { rb_check_arity(argc, 2, 2); - argv[0] = rb_enc_str_new(mname, (n-1), cWIN32OLE_enc); + argv[0] = rb_enc_associate(rb_str_subseq(mid, 0, n-1), cWIN32OLE_enc); return ole_propertyput(self, argv[0], argv[1]); } else { - argv[0] = rb_enc_str_new(mname, n, cWIN32OLE_enc); + argv[0] = rb_enc_associate(rb_str_dup(mid), cWIN32OLE_enc); return ole_invoke(argc, argv, self, DISPATCH_METHOD|DISPATCH_PROPERTYGET, FALSE); } } |