Skip to content

Commit

Permalink
Fixed resolve() double endslash defect
Browse files Browse the repository at this point in the history
  • Loading branch information
actionshrimp committed Jul 7, 2011
1 parent 0b0c766 commit bc745b6
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions plugin/NERD_tree.vim
Original file line number Diff line number Diff line change
Expand Up @@ -2297,7 +2297,7 @@ function! s:Path.readInfoFromDisk(fullpath)
let lastPathComponent = self.getLastPathComponent(0)

"get the path to the new node with the parent dir fully resolved
let hardPath = resolve(self.strTrunk()) . '/' . lastPathComponent
let hardPath = resolve(self.strTrunk()) . lastPathComponent

"if the last part of the path is a symlink then flag it as such
let self.isSymLink = (resolve(hardPath) != hardPath)
Expand Down Expand Up @@ -2472,9 +2472,13 @@ function! s:Path._str()
endfunction

"FUNCTION: Path.strTrunk() {{{3
"Gets the path without the last segment on the end.
"Gets the path without the last segment on the end, always with an endslash
function! s:Path.strTrunk()
return self.drive . '/' . join(self.pathSegments[0:-2], '/')
let toReturn = self.drive . '/' . join(self.pathSegments[0:-2], '/')
if toReturn !~# '\/$'
let toReturn .= '/'
endif
return toReturn
endfunction

"FUNCTION: Path.WinToUnixPath(pathstr){{{3
Expand Down Expand Up @@ -4122,4 +4126,4 @@ endfunction
"reset &cpo back to users setting
let &cpo = s:old_cpo

" vim: set sw=4 sts=4 et fdm=marker:
" vim: set sw=4 sts=4 et fdm=marker:

0 comments on commit bc745b6

Please sign in to comment.