fileinfo: implement os_fileinfo_size

this replaces os_get_file_size and file_info.stat.st_size
This commit is contained in:
Stefan Hoffmann
2014-08-08 16:25:33 +02:00
parent 3051015f89
commit aa378acdf5
6 changed files with 35 additions and 23 deletions

View File

@@ -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) {