@@ -244,6 +244,7 @@ parsePieces sink bound src = do
244244 res <- takeLine src
245245 src' <- case res of
246246 Nothing -> return (S.empty, Nothing)
247+ -- The _bs here should only contain boundary information
247248 Just (_bs, src') -> return src'
248249 res' <- takeLines src'
249250 case res' of
@@ -252,14 +253,14 @@ parsePieces sink bound src = do
252253 let ls' = map parsePair ls
253254 let x = do
254255 cd <- lookup contDisp ls'
255− ct <- lookup contType ls'
256+ let ct = lookup contType ls'
256257 let attrs = parseAttrs cd
257258 let nameBS = S8.pack "name"
258259 name <- lookup nameBS attrs
259260 let fnBS = S8.pack "filename"
260261 return (ct, name, lookup fnBS attrs)
261262 case x of
262− Just (ct, name, Just filename) -> do
263+ Just (Just ct, name, Just filename) -> do
263264 seed <- sinkInit sink
264265 (seed', wasFound, msrc''') <-
265266 sinkTillBound bound src'' (sinkAppend sink) seed
@@ -283,7 +284,7 @@ parsePieces sink bound src = do
283284 then parsePieces sink bound msrc'''
284285 else return ([], [])
285286 return (x' : xs, ys)
286− Nothing -> do
287+ _ -> do
287288 -- ignore this part
288289 let seed = ()
289290 iter () _ = return ()