mirror of
https://github.com/neovim/neovim
synced 2025-07-17 01:31:48 +00:00
[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 d0efc1c906
)
This commit is contained in:
@ -1508,11 +1508,11 @@ line_read_in:
|
|||||||
* compute the first offset.
|
* compute the first offset.
|
||||||
*/
|
*/
|
||||||
if (state == TS_BINARY) {
|
if (state == TS_BINARY) {
|
||||||
// Get the tag file size.
|
if (vim_fseek(fp, 0, SEEK_END) != 0) {
|
||||||
if ((filesize = vim_lseek(fileno(fp), (off_T)0L, SEEK_END)) <= 0) {
|
|
||||||
state = TS_LINEAR;
|
state = TS_LINEAR;
|
||||||
} else {
|
} 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
|
/* Calculate the first read offset in the file. Start
|
||||||
* the search in the middle of the file. */
|
* the search in the middle of the file. */
|
||||||
|
Reference in New Issue
Block a user