From 01163dfe9af567514cb0fd187ed7a82af92d44cb Mon Sep 17 00:00:00 2001
From: fr33domlover <fr33domlover@riseup.net>
Date: Tue, 10 Jul 2018 16:00:01 +0000
Subject: [PATCH] Darcs patch parser: Make sure we read the whole patch
 successfully

---
 src/Vervis/Darcs.hs | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/Vervis/Darcs.hs b/src/Vervis/Darcs.hs
index 9d1fc45..8e49d8b 100644
--- a/src/Vervis/Darcs.hs
+++ b/src/Vervis/Darcs.hs
@@ -273,7 +273,8 @@ readPatch path hash = do
     li <- handle =<< readLatestInventory path latestInventoryAllP
     mp <- loop pih (liPatches li) (fst <$> liPrevTag li)
     for mp $ \ (pi, pch) -> do
-        (_pir, hunks) <- handle =<< readCompressedPatch path pch P.patch
+        (_pir, hunks) <-
+            handle =<< readCompressedPatch path pch (P.patch <* A.endOfInput)
         let (an, ae) =
                 either error id $
                 A.parseOnly (author <* A.endOfInput) $ piAuthor pi