Skip to content

Commit f4b5566

Browse files
committed
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.
1 parent aaa27ee commit f4b5566

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

lib/mkmf.rb

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -931,11 +931,9 @@ def egrep_cpp(pat, src, opt = "", &b)
931931
xpopen(cpp_command('', opt)) do |f|
932932
if Regexp === pat
933933
puts(" ruby -ne 'print if #{pat.inspect}'")
934-
f.grep(pat) {|l|
934+
!f.grep(pat) {|l|
935935
puts "#{f.lineno}: #{l}"
936-
return true
937-
}
938-
false
936+
}.empty?
939937
else
940938
puts(" egrep '#{pat}'")
941939
system("egrep", pat, in: f)

0 commit comments

Comments
 (0)