Modify getFullArgs to include program name
authorRik Steenkamp <rik@ewps.nl>
Tue, 29 Dec 2015 13:38:40 +0000 (14:38 +0100)
committerBen Gamari <ben@smart-cactus.org>
Tue, 29 Dec 2015 13:38:50 +0000 (14:38 +0100)
commitb093e631fbef456a000107921d69b6b7b5845149
treeda49a42c1bc17df61acf8fda61f99e927d4e53c0
parent9cb79c538dcf9e06a0a64050c28a177ea061e664
Modify getFullArgs to include program name

Fixes an inconsistency of `getFullArgs` across operating systems. On
non-Windows systems the returning list did not include the program name
as the first element, while on Windows systems it did.

As `System.Environment` depends on this behaviour of `getFullArgs` under
Windows, this is now the behaviour across all operating systems.
Computation `getFullArgs` is now like the "raw" version of `getArgs`,
similar to `argv` in other languages.

This patch also fixes T10728 under Windows.

Reviewers: austin, hvr, erikd, #ghc_windows_task_force, Phyx, bgamari

Reviewed By: #ghc_windows_task_force, Phyx, bgamari

Subscribers: Phyx, thomie

Differential Revision: https://phabricator.haskell.org/D1713
libraries/base/GHC/Environment.hs
testsuite/tests/rts/T10728.hs