diff --git a/Library/Homebrew/cmd/audit.rb b/Library/Homebrew/cmd/audit.rb index dd41d9284c..9eac644adc 100644 --- a/Library/Homebrew/cmd/audit.rb +++ b/Library/Homebrew/cmd/audit.rb @@ -714,8 +714,10 @@ class FormulaAuditor if @strict if line =~ /system (["'][^"' ]*(?:\s[^"' ]*)+["'])/ bad_system = $1 - good_system = bad_system.gsub(" ", "\", \"") - problem "Use `system #{good_system}` instead of `system #{bad_system}` " + unless %w[| < > & ;].any? { |c| bad_system.include? c } + good_system = bad_system.gsub(" ", "\", \"") + problem "Use `system #{good_system}` instead of `system #{bad_system}` " + end end if line =~ /(require ["']formula["'])/