Escape grep_for text when using grep

The rak code already does this and it is necessary for grep as well.
This commit is contained in:
James Sanders 2010-02-03 09:38:35 +08:00 committed by Jeremy McAnally
parent af9b73e2af
commit 93b8e4e9b4

View File

@ -201,7 +201,7 @@ module Rails
def find_with_grep(text, where) def find_with_grep(text, where)
value = "" value = ""
Open3.popen3("grep -r '#{text}' #{where}") do |stdin, stdout, stderr| Open3.popen3("grep -r '#{Regexp.escape(text)}' #{where}") do |stdin, stdout, stderr|
value = stdout.read value = stdout.read
end end