aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Lynagh <igloo@earth.li>2008-09-10 22:15:44 +0000
committerIan Lynagh <igloo@earth.li>2008-09-10 22:15:44 +0000
commitf87767a43e697743f9040f11a7a6fa70fa451a81 (patch)
treec85780dfb7681548ff6a9265c322a8cb9fa8e6bb
parent6c7b7f069fc7439d46f86baec14d6f6279d264c3 (diff)
Fix installed haddock on Windows
-rw-r--r--src/Main.hs13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/Main.hs b/src/Main.hs
index 99887bbe..8bb58a34 100644
--- a/src/Main.hs
+++ b/src/Main.hs
@@ -144,13 +144,16 @@ main = handleTopExceptions $ do
if not (null fileArgs)
then do
- let libDir
- | Just dir <- getGhcLibDir flags = dir
- | otherwise =
+ libDir <- case getGhcLibDir flags of
+ Just dir -> return dir
+ Nothing ->
#ifdef IN_GHC_TREE
- error "No GhcLibDir found"
+ do m <- getExecDir
+ case m of
+ Nothing -> error "No GhcLibDir found"
+ Just d -> return (d </> "..")
#else
- libdir -- from GHC.Paths
+ return libdir -- from GHC.Paths
#endif
-- initialize GHC