Only temporarily replace TMPDIR if it's defined to be an empty string

This commit is contained in:
w0rp
2018-07-16 08:45:55 +01:00
parent 6e1a5d4189
commit fcd62342d5
2 changed files with 24 additions and 6 deletions

View File

@@ -280,7 +280,7 @@ endfunction
function! ale#util#Tempname() abort
let l:clear_tempdir = 0
if has('unix') && empty($TMPDIR)
if exists('$TMPDIR') && empty($TMPDIR)
let l:clear_tempdir = 1
let $TMPDIR = '/tmp'
endif
@@ -290,7 +290,6 @@ function! ale#util#Tempname() abort
finally
if l:clear_tempdir
let $TMPDIR = ''
silent! unlet! $TMPDIR
endif
endtry