summaryrefslogtreecommitdiff
path: root/lib/chef/util/diff.rb
diff options
context:
space:
mode:
authorLamont Granquist <lamont@opscode.com>2013-07-01 13:20:25 -0700
committerLamont Granquist <lamont@opscode.com>2013-07-01 13:20:25 -0700
commit10a5408c4e689a303163e9f11ae6befdeeee0d50 (patch)
treea5094971f6eb4421bae58a194bba45faf01127f4 /lib/chef/util/diff.rb
parent54ee5d9218b111e1109ba58c884e50317c41f08e (diff)
downloadchef-10a5408c4e689a303163e9f11ae6befdeeee0d50.tar.gz
diff without argument does not read in 8-bit
Diffstat (limited to 'lib/chef/util/diff.rb')
-rw-r--r--lib/chef/util/diff.rb3
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/chef/util/diff.rb b/lib/chef/util/diff.rb
index 49179f454e..ba8ef69203 100644
--- a/lib/chef/util/diff.rb
+++ b/lib/chef/util/diff.rb
@@ -126,9 +126,8 @@ class Chef
def is_binary?(path)
File.open(path) do |file|
- # NB: IO.read() returns ASCII-8BIT, we use File.readlines to get Encoding.default_external
# XXX: this slurps into RAM, but we should have already checked our diff has a reasonable size
- buff = file.readlines.join
+ buff = file.read
buff = "" if buff.nil?
begin
return buff !~ /\A[\s[:print:]]*\z/m