To: vim-dev@vim.org Subject: Patch 6.1.193 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit ------------ Patch 6.1.193 Problem: Crash in in_id_list() for an item with a "containedin" list. (Dave Fishburn) Solution: Check for a negative syntax id, used for keywords. Files: src/syntax.c *** ../vim61.192/src/syntax.c Sun May 5 12:24:43 2002 --- src/syntax.c Sun Sep 15 13:27:36 2002 *************** *** 5558,5570 **** /* If spp has a "containedin" list and "cur_si" is in it, return TRUE. */ if (cur_si != NULL && ssp->cont_in_list != NULL) { ! /* Ignore transparent items without a contains argument. */ ! while (cur_si->si_flags & HL_TRANS_CONT) --cur_si; ! if (in_id_list(NULL, ssp->cont_in_list, &(SYN_ITEMS(syn_buf)[cur_si->si_idx].sp_syn), SYN_ITEMS(syn_buf)[cur_si->si_idx].sp_flags & HL_CONTAINED)) ! return TRUE; } if (list == NULL) --- 5560,5575 ---- /* If spp has a "containedin" list and "cur_si" is in it, return TRUE. */ if (cur_si != NULL && ssp->cont_in_list != NULL) { ! /* Ignore transparent items without a contains argument. Double check ! * that we don't go back past the first one. */ ! while ((cur_si->si_flags & HL_TRANS_CONT) ! && cur_si > (stateitem_T *)(current_state.ga_data)) --cur_si; ! /* cur_si->si_idx is -1 for keywords, these never contain anything. */ ! if (cur_si->si_idx >= 0 && in_id_list(NULL, ssp->cont_in_list, &(SYN_ITEMS(syn_buf)[cur_si->si_idx].sp_syn), SYN_ITEMS(syn_buf)[cur_si->si_idx].sp_flags & HL_CONTAINED)) ! return TRUE; } if (list == NULL) *** ../vim61.192/src/version.c Mon Sep 23 21:12:18 2002 --- src/version.c Mon Sep 23 21:14:16 2002 *************** *** 608,609 **** --- 608,611 ---- { /* Add new patch number below this line */ + /**/ + 193, /**/ -- This planet has -- or rather had -- a problem, which was this: most of the people living on it were unhappy for pretty much of the time. Many solutions were suggested for this problem, but most of these were largely concerned with the movements of small green pieces of paper, which is odd because on the whole it wasn't the small green pieces of paper that were unhappy. -- Douglas Adams, "The Hitchhiker's Guide to the Galaxy" /// Bram Moolenaar -- Bram@moolenaar.net -- http://www.moolenaar.net \\\ /// Creator of Vim - Vi IMproved -- http://www.vim.org \\\ \\\ Project leader for A-A-P -- http://www.a-a-p.org /// \\\ Lord Of The Rings helps Uganda - http://iccf-holland.org/lotr.html ///