File tree 1 file changed +11
-8
lines changed
1 file changed +11
-8
lines changed Original file line number Diff line number Diff line change @@ -769,21 +769,24 @@ resolveFilesAndDeps ty buildComponentDir dirs names0 exts = do
769
769
thDeps =
770
770
case ty of
771
771
AllFiles ->
772
+ -- The dependent file path is surrounded by quotes but is not escaped.
773
+ -- It can be an absolute or relative path.
772
774
mapMaybe
773
- (fmap (dir </> ) .
774
- parseRelFile .
775
- T. unpack .
776
- decodeUtf8 .
777
- C8. takeWhile (/= ' "' ) .
778
- C8. dropWhile (== ' "' ) . C8. dropWhile (/= ' "' )) $
775
+ (parseAbsOrRelFile dir <=<
776
+ (fmap T. unpack .
777
+ (T. stripSuffix " \" " <=< T. stripPrefix " \" " ) .
778
+ decodeUtf8 . C8. dropWhile (/= ' "' ))) $
779
779
filter (" addDependentFile \" " `C8.isPrefixOf` ) dumpHI
780
780
Modules -> []
781
781
-- liftIO $ putStrLn $ "XXX dumpHI " ++ show dumpHIPath ++ "\n XXX moduleDeps=" ++ show moduleDeps ++ "\n XXX thDeps=" ++ show thDeps
782
- return
783
- (moduleDeps, thDeps)
782
+ return (moduleDeps, thDeps)
784
783
getHIDir = do
785
784
bld <- asks snd
786
785
return $ maybe bld (bld </> ) buildComponentDir
786
+ parseAbsOrRelFile dir fp =
787
+ case parseRelFile fp of
788
+ Just rel -> Just (dir </> rel)
789
+ Nothing -> parseAbsFile fp
787
790
788
791
-- | Try to resolve the list of base names in the given directory by
789
792
-- looking for unique instances of base names applied with the given
You can’t perform that action at this time.
0 commit comments