diff options
| author | Baptiste Fontaine | 2015-04-11 10:22:49 +0200 |
|---|---|---|
| committer | Mike McQuaid | 2015-04-12 21:34:53 -0700 |
| commit | affd66ae26283600ebfcc5f0649cf118e0c13e96 (patch) | |
| tree | fcda0b8f3f0b60c7f9637e9552da3f6b2d48bb0c /Library/Homebrew | |
| parent | 022436b1fd3f3d2c8a96a3e34e8bbd424d03e74a (diff) | |
| download | homebrew-affd66ae26283600ebfcc5f0649cf118e0c13e96.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 #38540.
Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
Diffstat (limited to 'Library/Homebrew')
| -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 |
