summaryrefslogtreecommitdiff
path: root/lib/chef/chef_fs/path_utils.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/chef/chef_fs/path_utils.rb')
-rw-r--r--lib/chef/chef_fs/path_utils.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/chef/chef_fs/path_utils.rb b/lib/chef/chef_fs/path_utils.rb
index 66dbd4f13b..8ec5c3df78 100644
--- a/lib/chef/chef_fs/path_utils.rb
+++ b/lib/chef/chef_fs/path_utils.rb
@@ -64,6 +64,7 @@ class Chef
def self.is_absolute?(path)
!!(path =~ /^#{regexp_path_separator}/)
end
+
# Given a path which may only be partly real (i.e. /x/y/z when only /x exists,
# or /x/y/*/blah when /x/y/z/blah exists), call File.realpath on the biggest
# part that actually exists. The paths operated on here are not Chef-FS paths.
@@ -114,8 +115,8 @@ class Chef
return nil unless PathUtils.os_path_eq?(candidate_fragment, ancestor)
if ancestor.length == path.length
""
- elsif path[ancestor.length,1] =~ /#{PathUtils.regexp_path_separator}/
- path[ancestor.length+1..-1]
+ elsif path[ancestor.length, 1] =~ /#{PathUtils.regexp_path_separator}/
+ path[ancestor.length + 1..-1]
else
nil
end