about summary refs log tree commit homepage
path: root/extras/exec_cgi.rb
diff options
context:
space:
mode:
Diffstat (limited to 'extras/exec_cgi.rb')
-rw-r--r--extras/exec_cgi.rb6
1 files changed, 2 insertions, 4 deletions
diff --git a/extras/exec_cgi.rb b/extras/exec_cgi.rb
index f143ac7..babda3c 100644
--- a/extras/exec_cgi.rb
+++ b/extras/exec_cgi.rb
@@ -31,10 +31,8 @@ class ExecCgi
     end
 
     def each
-      buf = @body_tip || ''.dup
-      if buf.size > 0
-        yield buf
-      end
+      buf = @body_tip
+      yield buf unless buf.empty?
 
       case tmp = @rd.read_nonblock(8192, buf, exception: false)
       when :wait_readable