From aa378acdf51daf235c7e721cfa646d115d8708f0 Mon Sep 17 00:00:00 2001 From: Stefan Hoffmann Date: Fri, 8 Aug 2014 16:25:33 +0200 Subject: fileinfo: implement os_fileinfo_size this replaces os_get_file_size and file_info.stat.st_size --- src/nvim/diff.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/nvim/diff.c') 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) { -- cgit From 5d074a0aa6b307a11ee572db6bf48ca17c3a8a23 Mon Sep 17 00:00:00 2001 From: Stefan Hoffmann Date: Wed, 27 Aug 2014 19:14:44 +0200 Subject: fileinfo: rename os_get_file_info{,_link,_fd} --- src/nvim/diff.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/nvim/diff.c') diff --git a/src/nvim/diff.c b/src/nvim/diff.c index e5fa277671..8b0bf4e997 100644 --- a/src/nvim/diff.c +++ b/src/nvim/diff.c @@ -948,7 +948,7 @@ void ex_diffpatch(exarg_T *eap) // Only continue if the output file was created. FileInfo file_info; - bool info_ok = os_get_file_info((char *)tmp_new, &file_info); + bool info_ok = os_fileinfo((char *)tmp_new, &file_info); off_t filesize = os_fileinfo_size(&file_info); if (!info_ok || filesize == 0) { EMSG(_("E816: Cannot read patch output")); -- cgit From 7ac191ab1085875319e139b044ec1f98498b87ce Mon Sep 17 00:00:00 2001 From: Stefan Hoffmann Date: Wed, 27 Aug 2014 22:36:38 +0200 Subject: fileinfo: change returntype of os_fileinfo_size off_t -> uint64_t --- src/nvim/diff.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/nvim/diff.c') diff --git a/src/nvim/diff.c b/src/nvim/diff.c index 8b0bf4e997..73b5731ad0 100644 --- a/src/nvim/diff.c +++ b/src/nvim/diff.c @@ -949,7 +949,7 @@ void ex_diffpatch(exarg_T *eap) // Only continue if the output file was created. FileInfo file_info; bool info_ok = os_fileinfo((char *)tmp_new, &file_info); - off_t filesize = os_fileinfo_size(&file_info); + uint64_t filesize = os_fileinfo_size(&file_info); if (!info_ok || filesize == 0) { EMSG(_("E816: Cannot read patch output")); } else { -- cgit