]> git.netwichtig.de Git - user/henk/code/ruby/rbot.git/commitdiff
url plugin: when reading body chunks, don't discard read material
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>
Sat, 24 Mar 2007 11:20:26 +0000 (11:20 +0000)
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>
Sat, 24 Mar 2007 11:20:26 +0000 (11:20 +0000)
data/rbot/plugins/url.rb

index e55999eec50264931671781897f01ab006704ae9..84ee7e436ed5a2c523bb98a1da8fa9e4f6f5792b 100644 (file)
@@ -40,10 +40,10 @@ class UrlPlugin < Plugin
 
       amount_read += chunk.length
 
-      if amount_read > amount
-        amount_of_overflow = amount_read - amount
-        chunk = chunk[0...-amount_of_overflow]
-      end
+      if amount_read > amount
+        amount_of_overflow = amount_read - amount
+        chunk = chunk[0...-amount_of_overflow]
+      end
 
       chunks << chunk