Commit 030b1a3a4b065d0aa750ea43238ccd1a95aa1f39

  • avatar
  • Peter Simons (Committer)
  • Wed Jul 16 20:46:15 CEST 2008
  • avatar
  • Marty Pauley <marty @ka…i.com> (Author)
  • Wed Jul 16 20:46:15 CEST 2008
Rfc2822: fixed bug concerning unstructured text that ends with whitespace

This patch fixes a bug when parsing unstructured text that ends with a
whitespace. The problem occurred because the trailing whitespace was
causing the optional "fws" to match inside the "do" in the "many" so it
was then expecting a "utext".
README
(2 / 2)
  
11Parsers for the Internet Message Standard
22=========================================
33
4:Latest Release: hsemail-1.2.tar.gz_
4:Latest Release: hsemail-1.3.tar.gz_
55:Darcs: darcs_ get --partial http://cryp.to/hsemail/
66
77Synopsis
4444
4545.. _darcs: http://abridgegame.org/darcs/
4646
47.. _hsemail-1.2.tar.gz: http://cryp.to/hsemail/hsemail-1.2.tar.gz
47.. _hsemail-1.3.tar.gz: http://cryp.to/hsemail/hsemail-1.3.tar.gz
4848
4949.. _Reference Documentation: docs/index.html
5050
  
213213-- follows the actual 'utext' is /included/ in the returned string.
214214
215215unstructured :: CharParser a String
216unstructured = do r1 <- many (do r1 <- option [] fws
217 r2 <- utext
218 return (r1 ++ [r2]))
219 r2 <- option [] fws
220 return (concat r1 ++ r2)
216unstructured = do r1 <- option [] fws
217 r2 <- many (do r1 <- utext
218 r2 <- option [] fws
219 return (r1 : r2))
220 return (r1 ++ concat r2)
221221 <?> "unstructured text"
222222
223223
  
11Name: hsemail
2Version: 1.2
2Version: 1.3
33Author: Peter Simons <simons@cryp.to>
44License: BSD3
55License-file: LICENSE