Permalink
Browse files

use system instead of rawSystem so we can forget whether or not the p…

…ager's command has spaces in it
  • Loading branch information...
1 parent 2a2dbed commit 2cd31e619b557b956604adc676cab0f4d2496a21 @mikeplus64 committed Dec 15, 2012
Showing with 4 additions and 4 deletions.
  1. +4 −4 ghc-core.hs
View
@@ -128,11 +128,11 @@ main = do
showInPager :: FilePath -> IO ExitCode
showInPager file = do
- (pager:opts) <- maybe ["less", "-R"] (addOpts . words) <$> getEnvMaybe "PAGER"
- rawSystem pager (opts ++ [file])
+ pager <- maybe "less -R" (addOpts . words) <$> getEnvMaybe "PAGER"
+ system (pager ++ " " ++ file)
where
- addOpts ("less":opts) | "-R" `elem` opts = "less":opts
- addOpts _ = ["less", "-R"]
+ addOpts ("less":opts) | "-R" `elem` opts = unwords ("less":opts)
+ addOpts _ = "less -R"
--
-- Clean up the output with some regular expressions.

0 comments on commit 2cd31e6

Please sign in to comment.