summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulien Dessaux2011-11-03 22:22:20 +0100
committerJulien Dessaux2011-11-03 22:22:20 +0100
commit899f76718f34761d4bc70354c67c508821a0e7c1 (patch)
treef21e878de5b840418baa3d9419b851351eb171bb
parentFixed the incorrect parsing of the TCP stream. (diff)
downloadhsbot-899f76718f34761d4bc70354c67c508821a0e7c1.tar.gz
hsbot-899f76718f34761d4bc70354c67c508821a0e7c1.tar.bz2
hsbot-899f76718f34761d4bc70354c67c508821a0e7c1.zip
Fixed the fix to properly handle incomplete messages when there is nothing more to read.
-rw-r--r--Hsbot/Core.hs2
1 files changed, 1 insertions, 1 deletions
diff --git a/Hsbot/Core.hs b/Hsbot/Core.hs
index 43276f9..d454c77 100644
--- a/Hsbot/Core.hs
+++ b/Hsbot/Core.hs
@@ -120,7 +120,7 @@ botReader env handle mctx chan = do
errorM "Hsbot.Reader" $ "Reader decode error (" ++ show err ++ ") on " ++ str
botTrueReader ""
messages = do
- msgs <- many1 message
+ msgs <- option [] $ many1 message
trash <- option "" $ many1 anyChar
return (msgs, trash)
message = do