summaryrefslogtreecommitdiff
path: root/src/Text/Pandoc
diff options
context:
space:
mode:
authormpickering <matthewtpickering@gmail.com>2014-08-21 17:11:21 +0100
committermpickering <matthewtpickering@gmail.com>2014-08-21 17:11:21 +0100
commitaa808055f04951e4d6f580764ca755c4391c96b1 (patch)
tree10970a0f1fa63730bd27260127a65325316c1b43 /src/Text/Pandoc
parent3b6d7afa717ec933df096be8dc5c484657ca619f (diff)
Txt2Tags Reader: Fixed crash when reading from stdin
Diffstat (limited to 'src/Text/Pandoc')
-rw-r--r--src/Text/Pandoc/Readers/Txt2Tags.hs8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/Text/Pandoc/Readers/Txt2Tags.hs b/src/Text/Pandoc/Readers/Txt2Tags.hs
index c3a46a7f9..6f8c19ac7 100644
--- a/src/Text/Pandoc/Readers/Txt2Tags.hs
+++ b/src/Text/Pandoc/Readers/Txt2Tags.hs
@@ -75,9 +75,11 @@ getT2TMeta inps out = do
curDate <- formatTime defaultTimeLocale "%F" <$> getZonedTime
let getModTime = fmap (formatTime defaultTimeLocale "%T") .
getModificationTime
- curMtime <- catchIOError
- (maximum <$> mapM getModTime inps)
- (const (return ""))
+ curMtime <- case inps of
+ [] -> formatTime defaultTimeLocale "%T" <$> getZonedTime
+ _ -> catchIOError
+ (maximum <$> mapM getModTime inps)
+ (const (return ""))
return $ T2TMeta curDate curMtime (intercalate ", " inps) out
-- | Read Txt2Tags from an input string returning a Pandoc document