From e5cbee77a169c7f77948b4a61cc905c0eedbfca6 Mon Sep 17 00:00:00 2001 From: Austin Ziegler Date: Tue, 30 Jun 2020 22:00:44 -0400 Subject: [PATCH] Fix #44 The problem here was the precedence of `or` vs `||`. Switching to `||` resulted in the expected behaviour. --- lib/diff/lcs/ldiff.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/diff/lcs/ldiff.rb b/lib/diff/lcs/ldiff.rb index ec40a62..17b374c 100644 --- a/lib/diff/lcs/ldiff.rb +++ b/lib/diff/lcs/ldiff.rb @@ -105,7 +105,7 @@ def run(args, _input = $stdin, output = $stdout, error = $stderr) #:nodoc: if @binary.nil? old_txt = data_old[0, 4096].scan(/\0/).empty? new_txt = data_new[0, 4096].scan(/\0/).empty? - @binary = !old_txt or !new_txt + @binary = !old_txt || !new_txt end unless @binary