[前][次][番号順一覧][スレッド一覧]

ruby-changes:17473

From: usa <ko1@a...>
Date: Wed, 13 Oct 2010 12:10:55 +0900 (JST)
Subject: [ruby-changes:17473] Ruby:r29478 (trunk): * thread_win32.c (w32_error): get English message first, instead

usa	2010-10-13 12:10:49 +0900 (Wed, 13 Oct 2010)

  New Revision: 29478

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=29478

  Log:
    * thread_win32.c (w32_error): get English message first, instead
      of system default. see [ruby-core:32765].
      [experimental]

  Modified files:
    trunk/ChangeLog
    trunk/thread_win32.c

Index: thread_win32.c
===================================================================
--- thread_win32.c	(revision 29477)
+++ thread_win32.c	(revision 29478)
@@ -67,13 +67,20 @@
 w32_error(const char *func)
 {
     LPVOID lpMsgBuf;
-    FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER |
-		  FORMAT_MESSAGE_FROM_SYSTEM |
-		  FORMAT_MESSAGE_IGNORE_INSERTS,
-		  NULL,
-		  GetLastError(),
-		  MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
-		  (LPTSTR) & lpMsgBuf, 0, NULL);
+    if (FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER |
+		      FORMAT_MESSAGE_FROM_SYSTEM |
+		      FORMAT_MESSAGE_IGNORE_INSERTS,
+		      NULL,
+		      GetLastError(),
+		      MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US),
+		      (LPTSTR) & lpMsgBuf, 0, NULL) == 0)
+	FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER |
+		      FORMAT_MESSAGE_FROM_SYSTEM |
+		      FORMAT_MESSAGE_IGNORE_INSERTS,
+		      NULL,
+		      GetLastError(),
+		      MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
+		      (LPTSTR) & lpMsgBuf, 0, NULL);
     rb_bug("%s: %s", func, (char*)lpMsgBuf);
 }
 
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 29477)
+++ ChangeLog	(revision 29478)
@@ -1,3 +1,9 @@
+Wed Oct 13 12:10:02 2010  NAKAMURA Usaku  <usa@r...>
+
+	* thread_win32.c (w32_error): get English message first, instead
+	  of system default. see [ruby-core:32765].
+	  [experimental]
+
 Wed Oct 13 11:04:03 2010  Nobuyoshi Nakada  <nobu@r...>
 
 	* debug.c (ruby_set_debug_option): define always for binary

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]