fix a latent issue with windows paths surrounded by quotes

git-svn-id: file:///home/svn/framework3/trunk@10763 4d416f70-5f16-0410-b530-b9f4589650da
This commit is contained in:
James Lee 2010-10-20 09:50:12 +00:00
parent 182943fe6c
commit 44fa5c67a6
1 changed files with 4 additions and 0 deletions

View File

@ -27,6 +27,10 @@ module FileUtils
if (path) if (path)
path.split(::File::PATH_SEPARATOR).each { |base| path.split(::File::PATH_SEPARATOR).each { |base|
begin begin
# Deal with Windows paths surrounded by quotes. Prevents
# silliness like trying to look for
# '"C:\\framework\\nmap"\\nmap.exe' which will always fail.
base = $1 if base =~ /^"(.*)"$/
path = base + ::File::SEPARATOR + file_name path = base + ::File::SEPARATOR + file_name
if (::File::Stat.new(path) and not ::File.directory?(path)) if (::File::Stat.new(path) and not ::File.directory?(path))
return path return path