Skip to content

Commit e82e73a

Browse files
authored
Escape path before findfile or finddir (#1444)
1 parent 80cd62f commit e82e73a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

autoload/lsp/utils.vim

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ endfunction
197197

198198
" Find a nearest to a `path` parent directory `directoryname` by traversing the filesystem upwards
199199
function! lsp#utils#find_nearest_parent_directory(path, directoryname) abort
200-
let l:relative_path = finddir(a:directoryname, a:path . ';')
200+
let l:relative_path = finddir(a:directoryname, fnameescape(a:path) . ';')
201201

202202
if !empty(l:relative_path)
203203
return fnamemodify(l:relative_path, ':p')
@@ -208,7 +208,7 @@ endfunction
208208

209209
" Find a nearest to a `path` parent filename `filename` by traversing the filesystem upwards
210210
function! lsp#utils#find_nearest_parent_file(path, filename) abort
211-
let l:relative_path = findfile(a:filename, a:path . ';')
211+
let l:relative_path = findfile(a:filename, fnameescape(a:path) . ';')
212212

213213
if !empty(l:relative_path)
214214
return fnamemodify(l:relative_path, ':p')

0 commit comments

Comments
 (0)