fix a latent issue with windows paths surrounded by quotes
git-svn-id: file:///home/svn/framework3/trunk@10763 4d416f70-5f16-0410-b530-b9f4589650daunstable
parent
182943fe6c
commit
44fa5c67a6
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue