diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2014-09-04 01:22:25 -0400 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2014-09-04 01:22:25 -0400 |
commit | d66cd61b79d6d592436c4552dbdddb904dd1c22e (patch) | |
tree | 85e4651f4d56f6dc5b61df65eff9da9dd83ecce2 /src/nvim/diff.c | |
parent | 3051015f8907445bbb193a0781c75f9cdc54236e (diff) | |
parent | 7ac191ab1085875319e139b044ec1f98498b87ce (diff) | |
download | rneovim-d66cd61b79d6d592436c4552dbdddb904dd1c22e.tar.gz rneovim-d66cd61b79d6d592436c4552dbdddb904dd1c22e.tar.bz2 rneovim-d66cd61b79d6d592436c4552dbdddb904dd1c22e.zip |
Merge pull request #1054 from stefan991/fileinfo-getter
FileInfo getters for `filesize`, `hardlinks` and `blocksize`
Diffstat (limited to 'src/nvim/diff.c')
-rw-r--r-- | src/nvim/diff.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/nvim/diff.c b/src/nvim/diff.c index ab0c80112f..73b5731ad0 100644 --- a/src/nvim/diff.c +++ b/src/nvim/diff.c @@ -947,9 +947,10 @@ void ex_diffpatch(exarg_T *eap) os_remove((char *)buf); // Only continue if the output file was created. - off_t file_size; - bool file_size_success = os_get_file_size((char *)tmp_new, &file_size); - if (!file_size_success || file_size == 0) { + FileInfo file_info; + bool info_ok = os_fileinfo((char *)tmp_new, &file_info); + uint64_t filesize = os_fileinfo_size(&file_info); + if (!info_ok || filesize == 0) { EMSG(_("E816: Cannot read patch output")); } else { if (curbuf->b_fname != NULL) { |