diff options
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Homebrew/cmd/search.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Library/Homebrew/cmd/search.rb b/Library/Homebrew/cmd/search.rb index 66ce5d379..a51367e18 100644 --- a/Library/Homebrew/cmd/search.rb +++ b/Library/Homebrew/cmd/search.rb @@ -9,8 +9,9 @@ module Homebrew extend self exec "open", "http://pdb.finkproject.org/pdb/browse.php?summary=#{ARGV.next}" else query = ARGV.first - rx = if query =~ %r{^/(.*)/$} - Regexp.new($1) + rx = case query + when nil then "" + when %r{^/(.*)/$} then Regexp.new($1) else /.*#{Regexp.escape query}.*/i end |
