summaryrefslogtreecommitdiff
path: root/rts/RtsMain.c
diff options
context:
space:
mode:
authorAndreas Klebinger <klebinger.andreas@gmx.at>2017-07-27 18:16:09 +0100
committerTamar Christina <tamar@zhox.com>2017-07-27 21:16:02 +0100
commit7af0b906116e13fbd90f43f2f6c6b826df2dca77 (patch)
tree4da8912ab0408e22b119098dd64260b32e935bd9 /rts/RtsMain.c
parent791947db6db32ef7d4772a821a0823e558e3c05b (diff)
downloadhaskell-7af0b906116e13fbd90f43f2f6c6b826df2dca77.tar.gz
Initialize hs_init with UTF8 encoded arguments on Windows.
Summary: Get utf8 encoded arguments before we call hs_init and use them instead of ignoring hs_init arguments. This reduces differing behaviour of the RTS between windows and linux and simplifies the code involved. A few testcases were changed to expect the same result on windows as on linux after the changes. This fixes #13940. Test Plan: ./validate Reviewers: austin, hvr, bgamari, erikd, simonmar, Phyx Subscribers: Phyx, rwbarton, thomie GHC Trac Issues: #13940 Differential Revision: https://phabricator.haskell.org/D3739
Diffstat (limited to 'rts/RtsMain.c')
-rw-r--r--rts/RtsMain.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/rts/RtsMain.c b/rts/RtsMain.c
index d9f05576a0..57c38742b6 100644
--- a/rts/RtsMain.c
+++ b/rts/RtsMain.c
@@ -13,6 +13,7 @@
#include "RtsAPI.h"
#include "RtsUtils.h"
+#include "RtsFlags.h"
#include "Prelude.h"
#include "Task.h"
#include "Excn.h"
@@ -48,6 +49,16 @@ int hs_main ( int argc, char *argv[], // program args
int exit_status;
SchedulerStatus status;
+ // See Note: [Windows Unicode Arguments] in rts/RtsFlags.c
+ #if defined(mingw32_HOST_OS)
+ {
+ argv = getUTF8Args(&argc);
+ }
+ #endif
+
+
+
+
hs_init_ghc(&argc, &argv, rts_config);
// kick off the computation by creating the main thread with a pointer