From 297afd0aa989219386f518291dab3a3e148bc311 Mon Sep 17 00:00:00 2001 From: John MacFarlane <jgm@berkeley.edu> Date: Mon, 16 Sep 2019 08:30:57 -0700 Subject: [PATCH] PDF: Fix test for Cygwin. See #5451. --- src/Text/Pandoc/PDF.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Text/Pandoc/PDF.hs b/src/Text/Pandoc/PDF.hs index a9114e8d5..17aec792d 100644 --- a/src/Text/Pandoc/PDF.hs +++ b/src/Text/Pandoc/PDF.hs @@ -28,7 +28,7 @@ import Data.Maybe (fromMaybe) import Data.Text (Text) import qualified Data.Text as T import Text.Printf (printf) -import Data.Char (ord, isAscii) +import Data.Char (ord, isAscii, isSpace) import System.Directory import System.Environment import System.Exit (ExitCode (..)) @@ -93,7 +93,7 @@ makePDF program pdfargs writer opts doc = uname <- E.catch (do (ec, sout, _) <- readProcessWithExitCode "uname" ["-o"] "" if ec == ExitSuccess - then return $ Just sout + then return $ Just $ filter (not . isSpace) sout else return Nothing) (\(_ :: E.SomeException) -> return Nothing) if '~' `elem` tmp || uname == Just "Cygwin" -- see #5451