From ac45c24e3a451f89ba03e18044d59cd05d14d6df Mon Sep 17 00:00:00 2001 From: Kazu Yamamoto Date: Mon, 31 Mar 2014 12:32:00 +0900 Subject: [PATCH] fixing a bug of removeMainTarget. If CPP is specified, a temprary file name was used. --- src/GHCModi.hs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/GHCModi.hs b/src/GHCModi.hs index 6474670..6139778 100644 --- a/src/GHCModi.hs +++ b/src/GHCModi.hs @@ -136,7 +136,10 @@ checkStx set ls readLog file = do case mx of Nothing -> return Nothing Just x -> do - let mainfile = G.ms_hspp_file x + let mmainfile = G.ml_hs_file (G.ms_location x) + -- G.ms_hspp_file x is a temporary file with CPP. + -- this is a just fake. + mainfile = fromMaybe (G.ms_hspp_file x) mmainfile if mainfile == file then return Nothing else do