You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 20, 2023. It is now read-only.
The following code fails to escape directories with a comma in their name:
" Start in directory a:where and walk up the parent folders until it finds a
" file named a:what; return path to that file
function! syntastic#util#findFileInParent(what, where) abort " {{{2
let old_suffixesadd = &suffixesadd
let &suffixesadd = ''
let file = findfile(a:what, escape(a:where, ' ') . ';')
let &suffixesadd = old_suffixesadd
return file
endfunction " }}}2
This manifests with the following test, assuming sphinx-build is present and selected as the checker:
touch conf.py
mkdir "a,b"
cd "a,b"
touch index.rst
vim index.rst
Since conf.py is invalid, correct behaviour is an error: syntastic: error: checker rst/sphinx returned abnormal status 1
Invalid behaviour is no error. With g:syntastic_debug = 32 the following will be logged in the failure case:
syntastic: 2.559280: rst/sphinx: syntastic_rst_sphinx_source_dir = ''
syntastic: 2.559755: rst/sphinx: conf.py file not found
The fix is to add a comma to the characters to be escaped:
" Start in directory a:where and walk up the parent folders until it finds a
" file named a:what; return path to that file
function! syntastic#util#findFileInParent(what, where) abort " {{{2
let old_suffixesadd = &suffixesadd
let &suffixesadd = ''
let file = findfile(a:what, escape(a:where, ' ,') . ';')
let &suffixesadd = old_suffixesadd
return file
endfunction " }}}2
Vim version as supplied with CentOS 7
VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Jun 10 2014 06:55:55)
Included patches: 1-160
Syntastic version installed with Vundle:
Syntastic version: 3.8.0-94 (Vim 704, Linux)
The text was updated successfully, but these errors were encountered:
Sadly the problem is not limited to comma, the sequence *( f.i. breaks findfile(), and no combination of escaping can fix that. Then again this is Vim, where all problems are solved to 95%. Handling filenames is broken beyond repair. Looking at the sources I never cease to be surprised that there aren't more bug reports about just about everything involving filenames. shrug
Slm0n87
pushed a commit
to Slm0n87/syntastic
that referenced
this issue
Mar 7, 2019
findfile() appears to have some undocumented behaviour regarding
commands in the path string. So escape them when we escape spaces.
Closesvim-syntastic#2109
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
The following code fails to escape directories with a comma in their name:
This manifests with the following test, assuming sphinx-build is present and selected as the checker:
Since conf.py is invalid, correct behaviour is an error:
syntastic: error: checker rst/sphinx returned abnormal status 1
Invalid behaviour is no error. With
g:syntastic_debug = 32
the following will be logged in the failure case:The fix is to add a comma to the characters to be escaped:
Vim version as supplied with CentOS 7
Syntastic version installed with Vundle:
The text was updated successfully, but these errors were encountered: