search: don't try to escape nil
Fixes Homebrew/homebrew#9575. Signed-off-by: Jack Nagel <jacknagel@gmail.com>
This commit is contained in:
parent
e9a0f24ccb
commit
6d1ef8d9ca
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user