lib/openssl/buffering.rb in rubysl-openssl-2.4.0 vs lib/openssl/buffering.rb in rubysl-openssl-2.5.0
- old
+ new
@@ -1,20 +1,16 @@
# coding: binary
+# frozen_string_literal: false
#--
-#= $RCSfile$ -- Buffering mix-in module.
-#
#= Info
# 'OpenSSL for Ruby 2' project
# Copyright (C) 2001 GOTOU YUUZOU <gotoyuzo@notwork.org>
# All rights reserved.
#
#= Licence
-# This program is licenced under the same licence as Ruby.
+# This program is licensed under the same licence as Ruby.
# (See the file 'LICENCE'.)
-#
-#= Version
-# $Id: buffering.rb 43964 2013-12-03 01:44:41Z drbrain $
#++
##
# OpenSSL IO buffering mix-in module.
#
@@ -211,10 +207,10 @@
if eol.is_a?(Regexp)
size = idx ? idx+$&.size : nil
else
size = idx ? idx+eol.size : nil
end
- if limit and limit >= 0
+ if size && limit && limit >= 0
size = [size, limit].min
end
consume_rbuff(size)
end