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/diff.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/diff.c')
-rw-r--r-- | src/diff.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/diff.c b/src/diff.c index a93f1324fe..e360edc665 100644 --- a/src/diff.c +++ b/src/diff.c @@ -863,8 +863,6 @@ void ex_diffpatch(exarg_T *eap) char_u dirbuf[MAXPATHL]; char_u *fullname = NULL; #endif // ifdef UNIX - struct stat st; - // We need two temp file names. // Name of original temp file. char_u *tmp_orig = vim_tempname('o'); @@ -965,7 +963,9 @@ void ex_diffpatch(exarg_T *eap) os_remove((char *)buf); // Only continue if the output file was created. - if ((mch_stat((char *)tmp_new, &st) < 0) || (st.st_size == 0)) { + off_t file_size; + bool file_size_success = os_get_file_size((char *)tmp_new, &file_size); + if (!file_size_success || file_size == 0) { EMSG(_("E816: Cannot read patch output")); } else { if (curbuf->b_fname != NULL) { |