From f87767a43e697743f9040f11a7a6fa70fa451a81 Mon Sep 17 00:00:00 2001 From: Ian Lynagh Date: Wed, 10 Sep 2008 22:15:44 +0000 Subject: Fix installed haddock on Windows --- src/Main.hs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'src') 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 -- cgit v1.2.3