4 From: Bram Moolenaar <Bram@moolenaar.net>
6 Content-Type: text/plain; charset=ISO-8859-1
7 Content-Transfer-Encoding: 8bit
11 Problem: Crash when using "\\[" and "\\]" in 'errorformat'. (Marc Weber)
12 Solution: Check for valid submatches after matching the pattern.
16 *** ../vim-7.0.020/src/quickfix.c Wed May 3 23:23:30 2006
17 --- src/quickfix.c Tue Jun 20 17:04:20 2006
23 ! * Extract error message data from matched line
25 if ((i = (int)fmt_ptr->addr[0]) > 0) /* %f */
27 ! int c = *regmatch.endp[i];
29 /* Expand ~/file and $HOME/file to full path. */
30 *regmatch.endp[i] = NUL;
31 expand_env(regmatch.startp[i], namebuf, CMDBUFFSIZE);
32 *regmatch.endp[i] = c;
37 ! * Extract error message data from matched line.
38 ! * We check for an actual submatch, because "\[" and "\]" in
39 ! * the 'errorformat' may cause the wrong submatch to be used.
41 if ((i = (int)fmt_ptr->addr[0]) > 0) /* %f */
45 ! if (regmatch.startp[i] == NULL || regmatch.endp[i] == NULL)
48 /* Expand ~/file and $HOME/file to full path. */
49 + c = *regmatch.endp[i];
50 *regmatch.endp[i] = NUL;
51 expand_env(regmatch.startp[i], namebuf, CMDBUFFSIZE);
52 *regmatch.endp[i] = c;
58 if ((i = (int)fmt_ptr->addr[1]) > 0) /* %n */
60 + if (regmatch.startp[i] == NULL)
62 enr = (int)atol((char *)regmatch.startp[i]);
64 if ((i = (int)fmt_ptr->addr[2]) > 0) /* %l */
66 + if (regmatch.startp[i] == NULL)
68 lnum = atol((char *)regmatch.startp[i]);
70 if ((i = (int)fmt_ptr->addr[3]) > 0) /* %c */
72 + if (regmatch.startp[i] == NULL)
74 col = (int)atol((char *)regmatch.startp[i]);
76 if ((i = (int)fmt_ptr->addr[4]) > 0) /* %t */
78 + if (regmatch.startp[i] == NULL)
80 type = *regmatch.startp[i];
82 if (fmt_ptr->flags == '+' && !multiscan) /* %+ */
83 STRCPY(errmsg, IObuff);
84 else if ((i = (int)fmt_ptr->addr[5]) > 0) /* %m */
86 + if (regmatch.startp[i] == NULL || regmatch.endp[i] == NULL)
88 len = (int)(regmatch.endp[i] - regmatch.startp[i]);
89 vim_strncpy(errmsg, regmatch.startp[i], len);
91 if ((i = (int)fmt_ptr->addr[6]) > 0) /* %r */
93 + if (regmatch.startp[i] == NULL)
95 tail = regmatch.startp[i];
97 if ((i = (int)fmt_ptr->addr[7]) > 0) /* %p */
99 + if (regmatch.startp[i] == NULL || regmatch.endp[i] == NULL)
101 col = (int)(regmatch.endp[i] - regmatch.startp[i] + 1);
102 if (*((char_u *)regmatch.startp[i]) != TAB)
105 if ((i = (int)fmt_ptr->addr[8]) > 0) /* %v */
107 + if (regmatch.startp[i] == NULL)
109 col = (int)atol((char *)regmatch.startp[i]);
112 if ((i = (int)fmt_ptr->addr[9]) > 0) /* %s */
114 + if (regmatch.startp[i] == NULL || regmatch.endp[i] == NULL)
116 len = (int)(regmatch.endp[i] - regmatch.startp[i]);
117 if (len > CMDBUFFSIZE - 5)
118 len = CMDBUFFSIZE - 5;
119 *** ../vim-7.0.020/src/version.c Tue Jun 20 16:33:21 2006
120 --- src/version.c Tue Jun 20 17:07:25 2006
124 { /* Add new patch number below this line */
130 TALL KNIGHT: We are now no longer the Knights Who Say Ni!
133 ONE KNIGHT: (whispers) Sorry.
134 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
136 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
137 /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
138 \\\ download, build and distribute -- http://www.A-A-P.org ///
139 \\\ help me help AIDS victims -- http://ICCF-Holland.org ///