diff options
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | win32/win32.c | 4 |
2 files changed, 10 insertions, 0 deletions
@@ -1,3 +1,9 @@ +Tue Oct 12 16:04:37 2010 NAKAMURA Usaku <usa@ruby-lang.org> + + * win32/win32.c (rb_w32_strerror): get English message first, instead + of system default. see [ruby-dev:42358]. + [experimental] + Tue Oct 12 15:52:35 2010 NAKAMURA Usaku <usa@ruby-lang.org> * win32/win32.c (rb_w32_strerror): unmap some range of errno for 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)); |