Text.Pandoc.PDF: Fix changePathSeparators for Windows.

Previously a path beginning with a drive, like
`C:\foo\bar`, was translated to `C:\/foo/bar`, which
caused problems.

With this fix, the backslashes are removed.

Closes #6173.
This commit is contained in:
John MacFarlane 2020-11-15 10:43:43 -08:00
parent 79907e5f17
commit f8225140a5

View file

@ -60,7 +60,10 @@ import Text.Pandoc.Logging
#ifdef _WINDOWS
changePathSeparators :: FilePath -> FilePath
changePathSeparators = intercalate "/" . splitDirectories
changePathSeparators =
-- We filter out backslashes because an initial `C:\` gets
-- retained by `splitDirectories`, see #6173:
intercalate "/" . map (filter (/='\\')) . splitDirectories
#endif
makePDF :: String -- ^ pdf creator (pdflatex, lualatex, xelatex,