audit: don't split shell commands when using a glob pattern
Without this, `brew audit <some formula>` may ask people to change:
system "./script.sh foo-*"
into:
system "./script.sh", "foo-*"
These are not the same. In the first example the shell expansion occurs
while it doesn’t in the second one, breaking the build.
Closes Homebrew/homebrew#38540.
Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
This commit is contained in:
parent
9c46e4be0a
commit
8363b35216
@ -720,7 +720,7 @@ class FormulaAuditor
|
||||
if @strict
|
||||
if line =~ /system (["'][^"' ]*(?:\s[^"' ]*)+["'])/
|
||||
bad_system = $1
|
||||
unless %w[| < > & ;].any? { |c| bad_system.include? c }
|
||||
unless %w[| < > & ; *].any? { |c| bad_system.include? c }
|
||||
good_system = bad_system.gsub(" ", "\", \"")
|
||||
problem "Use `system #{good_system}` instead of `system #{bad_system}` "
|
||||
end
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user