diff --git a/Library/Homebrew/cmd/audit.rb b/Library/Homebrew/cmd/audit.rb index 6743f2a469fd479b9078690f44a4dc8642b997d4..39d58a146c9daafc38ecb1d54c1c9b4083f65731 100644 --- a/Library/Homebrew/cmd/audit.rb +++ b/Library/Homebrew/cmd/audit.rb @@ -919,8 +919,8 @@ class FormulaAuditor problem "Use \#{pkgshare} instead of \#{share}/#{formula.name}" end - if line =~ %r{share/"#{Regexp.escape(formula.name)}[/'"]} - problem "Use pkgshare instead of (share/\"#{formula.name}\")" + if line =~ %r{share(\s*[/+]\s*)(['"])#{Regexp.escape(formula.name)}(?:\2|/)} + problem "Use pkgshare instead of (share#{$1}\"#{formula.name}\")" end end end