summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2026-04-09 10:32:30 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2026-04-09 12:18:33 +0900
commitf4b5566d0976f55b1fda8cea943283901a3fdc72 (patch)
treeddc7aeb0abd3c50ce54f954a24b0814e479dfa67
parentaaa27ee05754b0358ad3f1c7c5b3d56d626cc497 (diff)
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.
-rw-r--r--lib/mkmf.rb6
1 files 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)