To: vim_dev@googlegroups.com Subject: Patch 8.1.2152 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.1.2152 Problem: Problems navigating tags file on MacOS Catalina. Solution: Use fseek instead of lseek. (John Lamb, fixes #5061) Files: src/tag.c *** ../vim-8.1.2151/src/tag.c 2019-08-21 14:36:29.395376065 +0200 --- src/tag.c 2019-10-15 22:20:31.885463289 +0200 *************** *** 2198,2220 **** #endif #ifdef FEAT_TAG_BINS ! /* ! * When starting a binary search, get the size of the file and ! * compute the first offset. ! */ if (state == TS_BINARY) { ! /* Get the tag file size (don't use mch_fstat(), it's not ! * portable). */ ! if ((filesize = vim_lseek(fileno(fp), ! (off_T)0L, SEEK_END)) <= 0) state = TS_LINEAR; else { ! vim_lseek(fileno(fp), (off_T)0L, SEEK_SET); ! /* Calculate the first read offset in the file. Start ! * the search in the middle of the file. */ search_info.low_offset = 0; search_info.low_char = 0; search_info.high_offset = filesize; --- 2198,2220 ---- #endif #ifdef FEAT_TAG_BINS ! // When starting a binary search, get the size of the file and ! // compute the first offset. if (state == TS_BINARY) { ! if (vim_fseek(fp, 0L, SEEK_END) != 0) ! // can't seek, don't use binary search state = TS_LINEAR; else { ! // Get the tag file size (don't use mch_fstat(), it's ! // not portable). Don't use lseek(), it doesn't work ! // properly on MacOS Catalina. ! filesize = vim_ftell(fp); ! vim_fseek(fp, 0L, SEEK_SET); ! // Calculate the first read offset in the file. Start ! // the search in the middle of the file. search_info.low_offset = 0; search_info.low_char = 0; search_info.high_offset = filesize; *** ../vim-8.1.2151/src/version.c 2019-10-14 22:26:16.619956247 +0200 --- src/version.c 2019-10-15 22:23:24.992016047 +0200 *************** *** 755,756 **** --- 755,758 ---- { /* Add new patch number below this line */ + /**/ + 2152, /**/ -- It is illegal to take more than three sips of beer at a time while standing. [real standing law in Texas, United States of America] /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///