summaryrefslogtreecommitdiff
path: root/dln.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-10-15 23:39:16 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-10-15 23:39:16 +0000
commit92a7cf0455f716b7e5031d1a9ee60b14c3bef92a (patch)
tree90accfb3c7c3aeed404c44cb4fdec33540b45bc8 /dln.c
parentd2623b2281e9a2d8b9d751fc9816765f3960e5f8 (diff)
* dln.c (dln_strerror): get English message first, instead of
system default. see [ruby-dev:42358]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29514 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'dln.c')
-rw-r--r--dln.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/dln.c b/dln.c
index bb41f66..4e7addd 100644
--- a/dln.c
+++ b/dln.c
@@ -1127,10 +1127,12 @@ dln_strerror(char *message, size_t size)
char *p = message;
size_t len = snprintf(message, size, "%d: ", error);
- FormatMessage(
- FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS,
- NULL, error, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
- message + len, size - len, NULL);
+#define format_message(sublang) FormatMessage(\
+ FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, \
+ NULL, error, MAKELANGID(LANG_NEUTRAL, sublang), \
+ message + len, size - len, NULL)
+ if (format_message(SUBLANG_ENGLISH_US) == 0)
+ format_message(SUBLANG_DEFAULT);
for (p = message + len; *p; p++) {
if (*p == '\n' || *p == '\r')
*p = ' ';