Merge pull request #1926 from gnustomp/master

c#ParseCFlags: don't index empty list
This commit is contained in:
w0rp 2018-09-19 13:22:43 +01:00 committed by GitHub
commit 6bbbb9456c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -55,7 +55,7 @@ function! ale#c#ParseCFlags(path_prefix, cflag_line) abort
" Check if cflag contained a '-' and should not have been splitted
let l:option_list = split(l:option, '\zs')
if l:option_list[-1] isnot# ' '
if len(l:option_list) > 0 && l:option_list[-1] isnot# ' '
continue
endif

View File

@ -74,7 +74,7 @@ Execute(ParseCFlags should ignore -T and other arguments):
\ . ' -DTEST=`date +%s`',
\ ale#c#ParseCFlags(
\ ale#path#Simplify(g:dir. '/test_c_projects/makefile_project'),
\ 'gcc -Dgoal=9 -Tlinkerfile.ld blabla -Isubdir '
\ 'gcc -Dgoal=9 -Tlinkerfile.ld blabla -Isubdir --sysroot=subdir '
\ . '-I'. ale#path#Simplify('kernel/include')
\ . ' -DTEST=`date +%s` -c file.c'
\ )