summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2001-08-24 05:45:55 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2001-08-24 05:45:55 +0000
commite823796fdd09e81a3d033715b8006c0410031517 (patch)
tree258acc63f73694fe2f90385ce6858f1d6e8dd5f4
parentb09014e3938c1707d823493fe699dffeb66d6b51 (diff)
* dln.c (dln_strerror): fix a bug that sometimes made null message on
win32 (Tietew <tietew@tietew.net>'s patch). * win32/win32.c (mystrerror): ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@1709 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog7
-rw-r--r--dln.c2
-rw-r--r--win32/win32.c3
3 files changed, 10 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 049397364..c6518a774 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+Fri Aug 24 14:38:17 2001 Usaku Nakamura <usa@ruby-lang.org>
+
+ * dln.c (dln_strerror): fix a bug that sometimes made null message on
+ win32 (Tietew <tietew@tietew.net>'s patch).
+
+ * win32/win32.c (mystrerror): ditto.
+
Thu Aug 23 21:59:38 2001 Nobuyoshi Nakada <nobu.nakada@nifty.ne.jp>
* enum.c (sort_by_i): fix typo.
diff --git a/dln.c b/dln.c
index 2dd7b87cf..cbb267f6c 100644
--- a/dln.c
+++ b/dln.c
@@ -1153,7 +1153,7 @@ dln_strerror()
char *p = message;
p += sprintf(message, "%d: ", error);
FormatMessage(
- FORMAT_MESSAGE_FROM_SYSTEM,
+ FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS,
NULL,
error,
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
diff --git a/win32/win32.c b/win32/win32.c
index 27f425e00..52c361d27 100644
--- a/win32/win32.c
+++ b/win32/win32.c
@@ -1832,7 +1832,8 @@ mystrerror(int e)
if (e < 0 || e > sys_nerr) {
if (e < 0)
e = GetLastError();
- if (FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, &source, e, 0,
+ if (FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM |
+ FORMAT_MESSAGE_IGNORE_INSERTS, &source, e, 0,
buffer, 512, NULL) == 0) {
strcpy(buffer, "Unknown Error");
}