aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordm1try <me@dmitry.it>2019-10-14 14:58:41 +0300
committerDaniel Hahler <git@thequod.de>2019-10-14 14:05:58 +0200
commita1f557690f8e801c35a1b882c2a564231e4409a8 (patch)
tree580e0e67fe4020c4c48affd63b94a459fcf18cce
parentf2f37712a4511126350c470816136fd288aa04d0 (diff)
downloadrneovim-a1f557690f8e801c35a1b882c2a564231e4409a8.tar.gz
rneovim-a1f557690f8e801c35a1b882c2a564231e4409a8.tar.bz2
rneovim-a1f557690f8e801c35a1b882c2a564231e4409a8.zip
[release-0.4] mac: fix "tags file not sorted" bug on Catalina (#11222)
I/O in Catalina is currently known to be broken. This commit works around a pesky bug and also makes the code more consistent by removing the mix of C file and standard I/O. Fixes https://github.com/neovim/neovim/issues/11196 (cherry picked from commit d0efc1c9062441c9addc846429794ad4a06cc130)
-rw-r--r--src/nvim/tag.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/nvim/tag.c b/src/nvim/tag.c
index 91f3da1793..a311e103a5 100644
--- a/src/nvim/tag.c
+++ b/src/nvim/tag.c
@@ -1508,11 +1508,11 @@ line_read_in:
* compute the first offset.
*/
if (state == TS_BINARY) {
- // Get the tag file size.
- if ((filesize = vim_lseek(fileno(fp), (off_T)0L, SEEK_END)) <= 0) {
+ if (vim_fseek(fp, 0, SEEK_END) != 0) {
state = TS_LINEAR;
} else {
- vim_lseek(fileno(fp), (off_T)0L, SEEK_SET);
+ filesize = vim_ftell(fp);
+ vim_fseek(fp, 0, SEEK_SET);
/* Calculate the first read offset in the file. Start
* the search in the middle of the file. */