From f4b5566d0976f55b1fda8cea943283901a3fdc72 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Thu, 9 Apr 2026 10:32:30 +0900 Subject: mkmf: grep all occurrences in cpp output Apple clang aborts if cpp output is closed in middle, and leaves the preprocessed source and reproduction shell script. --- lib/mkmf.rb | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/mkmf.rb b/lib/mkmf.rb index 5f7a7d352a..39ba4030cc 100644 --- a/lib/mkmf.rb +++ b/lib/mkmf.rb @@ -931,11 +931,9 @@ SRC xpopen(cpp_command('', opt)) do |f| if Regexp === pat puts(" ruby -ne 'print if #{pat.inspect}'") - f.grep(pat) {|l| + !f.grep(pat) {|l| puts "#{f.lineno}: #{l}" - return true - } - false + }.empty? else puts(" egrep '#{pat}'") system("egrep", pat, in: f) -- cgit v1.2.3