Regexp escape VM names when matching for them.

This commit is contained in:
Mitchell Hashimoto 2012-01-24 17:03:55 -08:00
parent 0dbd012d6b
commit f48a2784a0
3 changed files with 3 additions and 3 deletions

View File

@ -1,6 +1,6 @@
## 0.9.4 (unreleased)
- Match VM names that have parens, brackets, etc.
## 0.9.3 (January 24, 2012)

View File

@ -172,7 +172,7 @@ module Vagrant
end
output = execute("list", "vms")
if output =~ /^"#{name}" \{(.+?)\}$/
if output =~ /^"#{Regexp.escape(name)}" \{(.+?)\}$/
return $1.to_s
end

View File

@ -172,7 +172,7 @@ module Vagrant
end
output = execute("list", "vms")
if output =~ /^"#{name}" \{(.+?)\}$/
if output =~ /^"#{Regexp.escape(name)}" \{(.+?)\}$/
return $1.to_s
end