diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-08-23 08:17:47 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-08-23 08:17:47 +0000 |
commit | 3134c5eb62155efbab3dd415ecfd22515ed2ddd0 (patch) | |
tree | d1754a07f8e753b9c35c389706dfd8b1b07cddf3 /ext/win32ole | |
parent | e2b08f40b3edd8a5601bf818e8047abde42501c7 (diff) | |
download | ruby-3134c5eb62155efbab3dd415ecfd22515ed2ddd0.tar.gz |
win32ole.c: no copy string
* ext/win32ole/win32ole.c (foletypelib_name, foletypelib_path):
WC2VSTR() returns a string in cWIN32OLE_enc, no need to copy another
string.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42660 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 88595a4b3f..ed5d9141c4 100644 --- a/ext/win32ole/win32ole.c +++ b/ext/win32ole/win32ole.c @@ -5281,7 +5281,7 @@ foletypelib_name(VALUE self) ole_raise(hr, eWIN32OLERuntimeError, "failed to get name from ITypeLib"); } name = WC2VSTR(bstr); - return rb_enc_str_new(StringValuePtr(name), strlen(StringValuePtr(name)), cWIN32OLE_enc); + return name; } /* @@ -5436,7 +5436,7 @@ foletypelib_path(VALUE self) pTypeLib->lpVtbl->ReleaseTLibAttr(pTypeLib, pTLibAttr); path = WC2VSTR(bstr); - return rb_enc_str_new(StringValuePtr(path), strlen(StringValuePtr(path)), cWIN32OLE_enc); + return path; } /* |