diff options
| author | Baptiste Fontaine | 2015-04-11 10:22:49 +0200 |
|---|---|---|
| committer | Mike McQuaid | 2015-04-12 21:34:53 -0700 |
| commit | 8363b352166c6f82108a6f64b3db16ecd4c0937c (patch) | |
| tree | 439a1b152d08d647ff73024371dfec7b9460cd1b /Library | |
| parent | 9c46e4be0a08fd86be107e0bdd59c4dfd645ca18 (diff) | |
| download | brew-8363b352166c6f82108a6f64b3db16ecd4c0937c.tar.bz2 | |
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>
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Homebrew/cmd/audit.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Library/Homebrew/cmd/audit.rb b/Library/Homebrew/cmd/audit.rb index b486af951..a17bfff29 100644 --- a/Library/Homebrew/cmd/audit.rb +++ b/Library/Homebrew/cmd/audit.rb @@ -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 |
