comparison src/quickfix.c @ 3949:37a4cacd2051 v7.3.730

updated for version 7.3.730 Problem: Crash in PHP file when using syntastic. (Ike Devolder) Solution: Avoid using NULL pointer. (Christian Brabandt)
author Bram Moolenaar <bram@vim.org>
date Wed, 28 Nov 2012 15:25:34 +0100
parents f4aa43d952f5
children eccae034465b
comparison
equal deleted inserted replaced
3948:b32bd5cc6afe 3949:37a4cacd2051
896 * If the current entry is not the last entry, delete entries below 896 * If the current entry is not the last entry, delete entries below
897 * the current entry. This makes it possible to browse in a tree-like 897 * the current entry. This makes it possible to browse in a tree-like
898 * way with ":grep'. 898 * way with ":grep'.
899 */ 899 */
900 while (qi->qf_listcount > qi->qf_curlist + 1) 900 while (qi->qf_listcount > qi->qf_curlist + 1)
901 {
902 if (wp != NULL && wp->w_llist == qi)
903 wp->w_llist = NULL;
904 qf_free(qi, --qi->qf_listcount); 901 qf_free(qi, --qi->qf_listcount);
905 }
906 902
907 /* 903 /*
908 * When the stack is full, remove to oldest entry 904 * When the stack is full, remove to oldest entry
909 * Otherwise, add a new entry. 905 * Otherwise, add a new entry.
910 */ 906 */
911 if (qi->qf_listcount == LISTCOUNT) 907 if (qi->qf_listcount == LISTCOUNT)
912 { 908 {
913 if (wp != NULL && wp->w_llist == qi)
914 wp->w_llist = NULL;
915 qf_free(qi, 0); 909 qf_free(qi, 0);
916 for (i = 1; i < LISTCOUNT; ++i) 910 for (i = 1; i < LISTCOUNT; ++i)
917 qi->qf_lists[i - 1] = qi->qf_lists[i]; 911 qi->qf_lists[i - 1] = qi->qf_lists[i];
918 qi->qf_curlist = LISTCOUNT - 1; 912 qi->qf_curlist = LISTCOUNT - 1;
919 } 913 }
2133 qfline_T *qfp; 2127 qfline_T *qfp;
2134 2128
2135 while (qi->qf_lists[idx].qf_count) 2129 while (qi->qf_lists[idx].qf_count)
2136 { 2130 {
2137 qfp = qi->qf_lists[idx].qf_start->qf_next; 2131 qfp = qi->qf_lists[idx].qf_start->qf_next;
2138 vim_free(qi->qf_lists[idx].qf_start->qf_text); 2132 if (qi->qf_lists[idx].qf_title != NULL)
2139 vim_free(qi->qf_lists[idx].qf_start->qf_pattern); 2133 {
2140 vim_free(qi->qf_lists[idx].qf_start); 2134 vim_free(qi->qf_lists[idx].qf_start->qf_text);
2135 vim_free(qi->qf_lists[idx].qf_start->qf_pattern);
2136 vim_free(qi->qf_lists[idx].qf_start);
2137 }
2141 qi->qf_lists[idx].qf_start = qfp; 2138 qi->qf_lists[idx].qf_start = qfp;
2142 --qi->qf_lists[idx].qf_count; 2139 --qi->qf_lists[idx].qf_count;
2143 } 2140 }
2144 vim_free(qi->qf_lists[idx].qf_title); 2141 vim_free(qi->qf_lists[idx].qf_title);
2145 qi->qf_lists[idx].qf_title = NULL; 2142 qi->qf_lists[idx].qf_title = NULL;