aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/diff.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/diff.c')
-rw-r--r--src/nvim/diff.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/nvim/diff.c b/src/nvim/diff.c
index ab0c80112f..e5fa277671 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_get_file_info((char *)tmp_new, &file_info);
+ off_t filesize = os_fileinfo_size(&file_info);
+ if (!info_ok || filesize == 0) {
EMSG(_("E816: Cannot read patch output"));
} else {
if (curbuf->b_fname != NULL) {