From 7a60fce085b5ae8d9f17699489415f20a5f18f8c Mon Sep 17 00:00:00 2001 From: Mirek Kratochvil Date: Mon, 23 Oct 2023 20:05:46 +0200 Subject: switch to a safe version of --- Utils.hs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'Utils.hs') diff --git a/Utils.hs b/Utils.hs index fa1bc09..1f39694 100644 --- a/Utils.hs +++ b/Utils.hs @@ -28,7 +28,7 @@ import System.Directory , doesDirectoryExist , getDirectoryContents ) -import System.FilePath ((), splitDirectories, takeDirectory) +import System.FilePath (splitDirectories, takeDirectory) import Text.Pandoc.Definition import qualified Text.Pandoc.Walk import Types @@ -96,6 +96,16 @@ unAbsolute = dropWhile (== '/') withPandocBlocks :: ([Block] -> [Block]) -> Pandoc -> Pandoc withPandocBlocks f (Pandoc meta blocks) = Pandoc meta (f blocks) +infixr 5 + +a b@('/':_) = + error + $ "internal error: unchecked concatenation of absolute path: " + ++ a + ++ " " + ++ b +a b = (System.FilePath.) a b + -- | Get all contents of a directory. (Interned from Hakyll.) getRecursiveContents :: (FilePath -> IO Bool) -- ^ Ignore this file/directory -- cgit v1.2.3