diff options
author | James McCoy <jamessan@jamessan.com> | 2016-11-16 09:24:10 -0500 |
---|---|---|
committer | James McCoy <jamessan@jamessan.com> | 2017-06-04 22:12:13 -0400 |
commit | 953f26bace041f481e79b67b64401aa07259055c (patch) | |
tree | af054b1eac1ffaefa9643deca7100ecb74f89138 /src/nvim/fileio.c | |
parent | 018383096c40aca83a76e1ae2a3ba8c5aac9b9af (diff) | |
download | rneovim-953f26bace041f481e79b67b64401aa07259055c.tar.gz rneovim-953f26bace041f481e79b67b64401aa07259055c.tar.bz2 rneovim-953f26bace041f481e79b67b64401aa07259055c.zip |
vim-patch:7.4.1975
Problem: On MS-Windows large files (> 2Gbyte) cause problems.
Solution: Use "off_T" instead of "off_t". Use "stat_T" instead of "struct
stat". Use 64 bit system functions if available. (Ken Takata)
https://github.com/vim/vim/commit/8767f52fbfd4f053ce00a978227c95f1d7d323fe
Only the off_T changes are relevant, since all the "struct stat" usage
is abstracted by libuv.
Diffstat (limited to 'src/nvim/fileio.c')
-rw-r--r-- | src/nvim/fileio.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/nvim/fileio.c b/src/nvim/fileio.c index 4063277403..42cc42b844 100644 --- a/src/nvim/fileio.c +++ b/src/nvim/fileio.c @@ -281,7 +281,7 @@ readfile ( colnr_T len; long size = 0; char_u *p = NULL; - off_t filesize = 0; + off_T filesize = 0; int skip_read = FALSE; context_sha256_T sha_ctx; int read_undo_file = FALSE; @@ -777,7 +777,7 @@ retry: if (read_buffer) { read_buf_lnum = 1; read_buf_col = 0; - } else if (read_stdin || lseek(fd, (off_t)0L, SEEK_SET) != 0) { + } else if (read_stdin || vim_lseek(fd, (off_T)0L, SEEK_SET) != 0) { /* Can't rewind the file, give up. */ error = TRUE; goto failed; @@ -1626,7 +1626,7 @@ rewind_retry: if ( try_unix && !read_stdin && (read_buffer - || lseek(fd, (off_t)0L, SEEK_SET) == 0)) { + || vim_lseek(fd, (off_T)0L, SEEK_SET) == 0)) { fileformat = EOL_UNIX; if (set_options) set_fileformat(EOL_UNIX, OPT_LOCAL); @@ -3833,7 +3833,7 @@ static bool msg_add_fileformat(int eol_type) /* * Append line and character count to IObuff. */ -void msg_add_lines(int insert_space, long lnum, off_t nchars) +void msg_add_lines(int insert_space, long lnum, off_T nchars) { char_u *p; |