diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2014-05-09 15:33:00 -0400 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2014-05-09 15:33:00 -0400 |
commit | 1a3ee71de258b416ca6b80f0a9e3b91460df8dc7 (patch) | |
tree | a59167e50add55b51ed31c65944cfa78ddd1c290 /src/quickfix.c | |
parent | f3dda65de157f2d7c35286018c20cbc7597ed748 (diff) | |
parent | eae498c4c5d34c1d0af40ecb430cbbc23b0a8e97 (diff) | |
download | rneovim-1a3ee71de258b416ca6b80f0a9e3b91460df8dc7.tar.gz rneovim-1a3ee71de258b416ca6b80f0a9e3b91460df8dc7.tar.bz2 rneovim-1a3ee71de258b416ca6b80f0a9e3b91460df8dc7.zip |
Merge pull request #619 from stefan991/mch_stat-cleanup
Replace `struct stat` with `FileInfo`
Diffstat (limited to 'src/quickfix.c')
-rw-r--r-- | src/quickfix.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/src/quickfix.c b/src/quickfix.c index 91ebe9795b..94b2b05501 100644 --- a/src/quickfix.c +++ b/src/quickfix.c @@ -2573,9 +2573,6 @@ static char_u *get_mef_name(void) char_u *name; static int start = -1; static int off = 0; -#ifdef HAVE_LSTAT - struct stat sb; -#endif if (*p_mef == NUL) { name = vim_tempname('e'); @@ -2602,13 +2599,12 @@ static char_u *get_mef_name(void) STRCPY(name, p_mef); sprintf((char *)name + (p - p_mef), "%d%d", start, off); STRCAT(name, p + 2); - if (!os_file_exists(name) -#ifdef HAVE_LSTAT - /* Don't accept a symbolic link, its a security risk. */ - && mch_lstat((char *)name, &sb) < 0 -#endif - ) + // Don't accept a symbolic link, its a security risk. + FileInfo file_info; + bool file_or_link_found = os_get_file_info_link((char *)name, &file_info); + if (!file_or_link_found) { break; + } free(name); } return name; |