@@ -95,7 +95,7 @@ setupCDDLCEnv = do
95
95
babbage <- map takePath <$> Babbage. readBabbageCddlFileNames
96
96
conway <- map takePath <$> Conway. readConwayCddlFileNames
97
97
98
- localDataDir <- takePath <$> getDataDir
98
+ localDataDir <- windowsPathHack <$> getDataDir
99
99
let local_paths =
100
100
map
101
101
(localDataDir F. </> )
@@ -135,22 +135,25 @@ cddlc dataFile = do
135
135
where
136
136
red s = putStrLn $ " \ESC [31m" <> s <> " \ESC [0m"
137
137
138
- takePath :: FilePath -> FilePath
139
- takePath x =
138
+ -- | @cddlc@ is not capable of using backlashes
139
+ --
140
+ -- @cddlc@ mixes @C:@ with the separator in @CDDL_INCLUDE_PATH@, and it
141
+ -- doesn't understand @;@ as a separator. It works if we remove @C:@ and we
142
+ -- are running in the same drive as the cddl files.
143
+ windowsPathHack :: FilePath -> FilePath
144
+ windowsPathHack x =
140
145
#ifdef mingw32_HOST_OS
141
- -- @cddlc@ is not capable of using backlashes
142
- --
143
- -- @cddlc@ mixes @C:@ with the separator in @CDDL_INCLUDE_PATH@, and it
144
- -- doesn't understand @;@ as a separator. It works if we remove @C:@ and we
145
- -- are running in the same drive as the cddl files.
146
- let f = [ if c /= ' \\ ' then c else ' /' | c <- F. takeDirectory x ]
146
+ let f = [ if c /= ' \\ ' then c else ' /' | c <- x ]
147
147
in if " C:" `L.isPrefixOf` f
148
148
then drop 2 f
149
149
else f
150
150
#else
151
- F. takeDirectory x
151
+ x
152
152
#endif
153
153
154
+ takePath :: FilePath -> FilePath
155
+ takePath = windowsPathHack . F. takeDirectory
156
+
154
157
probeTools :: IO ()
155
158
probeTools = do
156
159
putStrLn " Probing tools:"
0 commit comments