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}"
|
exec "open", "http://pdb.finkproject.org/pdb/browse.php?summary=#{ARGV.next}"
|
||||||
else
|
else
|
||||||
query = ARGV.first
|
query = ARGV.first
|
||||||
rx = if query =~ %r{^/(.*)/$}
|
rx = case query
|
||||||
Regexp.new($1)
|
when nil then ""
|
||||||
|
when %r{^/(.*)/$} then Regexp.new($1)
|
||||||
else
|
else
|
||||||
/.*#{Regexp.escape query}.*/i
|
/.*#{Regexp.escape query}.*/i
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user