Correctly resolve temp files on macOS

On macOS, the `$TMPDIR` is in `/var`. However, `/var -> /private/var`.
This means that fully resolved temp filenames weren't always getting
checked against the proper prefix.

This was affecting some of the Haskell plugins, though I'm sure it could
have affected any program that resolved past the generated `$TMPDIR/foo`
and wound up at a different filename.
This commit is contained in:
Jacob Zimmerman 2017-07-09 02:13:14 -05:00
parent ab47011ef2
commit a70591fa76
No known key found for this signature in database
GPG key ID: E15F286C541964F7

View file

@ -73,6 +73,7 @@ endfunction
function! ale#path#IsTempName(filename) abort function! ale#path#IsTempName(filename) abort
let l:prefix_list = [ let l:prefix_list = [
\ $TMPDIR, \ $TMPDIR,
\ resolve($TMPDIR),
\ '/run/user', \ '/run/user',
\] \]