Skip to content

Commit

Permalink
mac: fix "tags file not sorted" bug on Catalina (#11222)
Browse files Browse the repository at this point in the history
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 #11196
  • Loading branch information
dm1try authored and mhinz committed Oct 14, 2019
1 parent ba08288 commit d0efc1c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/nvim/tag.c
Original file line number Diff line number Diff line change
Expand Up @@ -1508,11 +1508,11 @@ find_tags (
* 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. */
Expand Down

0 comments on commit d0efc1c

Please sign in to comment.