mirror of
https://github.com/jgm/pandoc.git
synced 2026-09-25 17:05:41 +00:00
Workaround for problem with file-embed.
file-embed uses forward slashes as path separators, even on Windows. So we just convert backslashes to forward before doing a lookup.
This commit is contained in:
@@ -512,10 +512,12 @@ dataFiles = $(embedDir "data")
|
||||
readDefaultDataFile :: FilePath -> IO B.ByteString
|
||||
readDefaultDataFile fname =
|
||||
#ifdef EMBED_DATA_FILES
|
||||
case lookup fname dataFiles of
|
||||
case lookup (map backToForwardSlash fname) dataFiles of
|
||||
Nothing -> ioError $ userError
|
||||
$ "Data file `" ++ fname ++ "' does not exist"
|
||||
Just contents -> return contents
|
||||
where backToForwardSlash '\\' = '/'
|
||||
backToForwardSlash c = c
|
||||
#else
|
||||
getDataFileName ("data" </> fname) >>= B.readFile
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user