mirror of
https://github.com/vim/vim.git
synced 2025-09-24 03:44:06 -04:00
patch 8.0.1439: if cscope fails a search Vim may hang
Problem: If cscope fails a search Vim may hang. Solution: Bail out when a search error is encountered. (Safouane Baroudi, closes #2598)
This commit is contained in:
@@ -677,7 +677,7 @@ cs_cnt_matches(int idx)
|
|||||||
{
|
{
|
||||||
char *stok;
|
char *stok;
|
||||||
char *buf;
|
char *buf;
|
||||||
int nlines;
|
int nlines = 0;
|
||||||
|
|
||||||
buf = (char *)alloc(CSREAD_BUFSIZE);
|
buf = (char *)alloc(CSREAD_BUFSIZE);
|
||||||
if (buf == NULL)
|
if (buf == NULL)
|
||||||
@@ -700,7 +700,10 @@ cs_cnt_matches(int idx)
|
|||||||
* cscope will output error messages before the number-of-lines output.
|
* cscope will output error messages before the number-of-lines output.
|
||||||
* Display/discard any output that doesn't match what we want.
|
* Display/discard any output that doesn't match what we want.
|
||||||
* Accept "\S*cscope: X lines", also matches "mlcscope".
|
* Accept "\S*cscope: X lines", also matches "mlcscope".
|
||||||
|
* Bail out for the "Unable to search" error.
|
||||||
*/
|
*/
|
||||||
|
if (strstr((const char *)stok, "Unable to search database") != NULL)
|
||||||
|
break;
|
||||||
if ((stok = strtok(buf, (const char *)" ")) == NULL)
|
if ((stok = strtok(buf, (const char *)" ")) == NULL)
|
||||||
continue;
|
continue;
|
||||||
if (strstr((const char *)stok, "cscope:") == NULL)
|
if (strstr((const char *)stok, "cscope:") == NULL)
|
||||||
|
@@ -771,6 +771,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
1439,
|
||||||
/**/
|
/**/
|
||||||
1438,
|
1438,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user