summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsuke <suke@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-06-22 12:28:07 +0000
committersuke <suke@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-06-22 12:28:07 +0000
commit0c38c9ece890d738c9ded913842e750338c68544 (patch)
tree3e79509ce1ad83f44ffa004cb3b89da63c361a12
parente6a142476ac49438e0e92ec342b7a56a1f563e48 (diff)
downloadruby-0c38c9ece890d738c9ded913842e750338c68544.tar.gz
ruby-0c38c9ece890d738c9ded913842e750338c68544.tar.xz
ruby-0c38c9ece890d738c9ded913842e750338c68544.zip
* ext/win32ole/win32ole.c (OLE_FREE): should not call CoFreeUnuse-
dLibraries(). * ext/win32ole/win32ole.c (ole_event_free): ditto. * ext/win32ole/win32ole.c (ole_hresult2msg): truncate error message before CR. git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@6494 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog10
-rw-r--r--ext/win32ole/win32ole.c17
2 files changed, 18 insertions, 9 deletions
diff --git a/ChangeLog b/ChangeLog
index 7912bd71e..3b2abd115 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+Tue Jun 22 21:11:36 2004 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+
+ * ext/win32ole/win32ole.c (OLE_FREE): should not call CoFreeUnuse-
+ dLibraries().
+
+ * ext/win32ole/win32ole.c (ole_event_free): ditto.
+
+ * ext/win32ole/win32ole.c (ole_hresult2msg): truncate error message
+ before CR.
+
Tue Jun 22 16:47:42 2004 Shugo Maeda <shugo@ruby-lang.org>
* lib/net/ftp.rb (MDTM_REGEXP): fix for demon's ftp server.
diff --git a/ext/win32ole/win32ole.c b/ext/win32ole/win32ole.c
index 020105791..6ca066803 100644
--- a/ext/win32ole/win32ole.c
+++ b/ext/win32ole/win32ole.c
@@ -67,7 +67,6 @@
(x) = 0;\
}\
}\
- CoFreeUnusedLibraries();\
}
#define OLEData_Get_Struct(obj, pole) {\
@@ -79,7 +78,7 @@
#define WC2VSTR(x) ole_wc2vstr((x), TRUE)
-#define WIN32OLE_VERSION "0.5.6"
+#define WIN32OLE_VERSION "0.5.7"
typedef HRESULT (STDAPICALLTYPE FNCOCREATEINSTANCEEX)
(REFCLSID, IUnknown*, DWORD, COSERVERINFO*, DWORD, MULTI_QI*);
@@ -488,7 +487,8 @@ ole_hresult2msg(hr)
HRESULT hr;
{
VALUE msg = Qnil;
- char *p_msg;
+ char *p_msg = NULL;
+ char *term = NULL;
DWORD dwCount;
char strhr[100];
@@ -501,15 +501,15 @@ ole_hresult2msg(hr)
NULL, hr, LOCALE_SYSTEM_DEFAULT,
(LPTSTR)&p_msg, 0, NULL);
if (dwCount > 0) {
- /* remove dots and CRs/LFs */
- while (dwCount > 0 &&
- (p_msg[dwCount-1] < ' ' || p_msg[dwCount-1] == '.')) {
- p_msg[--dwCount] = '\0';
- }
+ term = strrchr(p_msg, '\r');
+ if (term) {
+ *term = '\0';
+ }
if (p_msg[0] != '\0') {
rb_str_cat2(msg, p_msg);
}
}
+ LocalFree(p_msg);
return msg;
}
@@ -5230,7 +5230,6 @@ ole_event_free(poleev)
pcp->lpVtbl->Unadvise(pcp, poleev->pEvent->m_dwCookie);
OLE_RELEASE(pcp);
}
- CoFreeUnusedLibraries();
}
}