summaryrefslogtreecommitdiff
path: root/rts/RtsFlags.c
diff options
context:
space:
mode:
authorAndreas Klebinger <klebinger.andreas@gmx.at>2017-02-23 13:46:15 -0500
committerBen Gamari <ben@smart-cactus.org>2017-02-23 17:26:44 -0500
commit6ca6a360c2b71d7e0c77a819dc463b37efe7a39d (patch)
treeb8c5856ce8332b5ddca75f1817dcad7395f0784a /rts/RtsFlags.c
parent7d116e553f0b44723e279ae5affa744e6aefc3c0 (diff)
downloadhaskell-6ca6a360c2b71d7e0c77a819dc463b37efe7a39d.tar.gz
base: Add handling of -- to getArgs for Windows
getArgs didn't match the treatmeant of -- in the RTS leading to inconsistencies between behavior on Windows and other platforms. See #13287. Reviewers: austin, hvr, bgamari, erikd, simonmar, rwbarton Reviewed By: bgamari, rwbarton Subscribers: rwbarton, thomie Differential Revision: https://phabricator.haskell.org/D3147
Diffstat (limited to 'rts/RtsFlags.c')
-rw-r--r--rts/RtsFlags.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/rts/RtsFlags.c b/rts/RtsFlags.c
index 5fd368cb61..6ab70d4888 100644
--- a/rts/RtsFlags.c
+++ b/rts/RtsFlags.c
@@ -512,6 +512,13 @@ static void errorRtsOptsDisabled(const char *s)
- rtsConfig (global) contains the supplied RtsConfig
+ On Windows getArgs ignores argv and instead takes the arguments directly
+ from the WinAPI and removes any which would have been parsed by the RTS.
+
+ If the handling of which arguments are passed to the Haskell side changes
+ these changes have to be synchronized with getArgs in base. See #13287 and
+ Note [Ignore hs_init argv] in System.Environment.
+
-------------------------------------------------------------------------- */
void setupRtsFlags (int *argc, char *argv[], RtsConfig rts_config)
@@ -566,7 +573,7 @@ void setupRtsFlags (int *argc, char *argv[], RtsConfig rts_config)
// Split arguments (argv) into PGM (argv) and RTS (rts_argv) parts
// argv[0] must be PGM argument -- leave in argv
-
+ //
for (mode = PGM; arg < total_arg; arg++) {
// The '--RTS' argument disables all future +RTS ... -RTS processing.
if (strequal("--RTS", argv[arg])) {