aboutsummaryrefslogtreecommitdiffstats
path: root/win32/win32.c
diff options
context:
space:
mode:
Diffstat (limited to 'win32/win32.c')
-rw-r--r--win32/win32.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/win32/win32.c b/win32/win32.c
index da4677bc4a..18b1dfb5af 100644
--- a/win32/win32.c
+++ b/win32/win32.c
@@ -2214,6 +2214,10 @@ rb_w32_strerror(int e)
}
#endif
if (FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM |
+ FORMAT_MESSAGE_IGNORE_INSERTS, &source, e,
+ MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US),
+ buffer, sizeof(buffer), NULL) == 0 &&
+ FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM |
FORMAT_MESSAGE_IGNORE_INSERTS, &source, e, 0,
buffer, sizeof(buffer), NULL) == 0)
strlcpy(buffer, "Unknown Error", sizeof(buffer));