| 16469 | } |
| 16470 | |
| 16471 | static char *search_code_scan_error(search_scratch_t *scratch, const char *output_path, |
| 16472 | bool has_path_filter, cbm_regex_t *path_regex, char *root_path, |
| 16473 | char *pattern, char *project, char *file_pattern, |
| 16474 | mcp_scan_cause_t cause, const char *message) { |
| 16475 | if (output_path && output_path[0]) { |
| 16476 | (void)cbm_unlink(output_path); |
| 16477 | } |
| 16478 | search_scratch_close(scratch); |
| 16479 | if (has_path_filter) { |
| 16480 | cbm_regfree(path_regex); |
| 16481 | } |
| 16482 | free(root_path); |
| 16483 | free(pattern); |
| 16484 | free(project); |
| 16485 | free(file_pattern); |
| 16486 | if (cause == MCP_SCAN_DEADLINE) { |
| 16487 | return search_code_timeout_result(); |
| 16488 | } |
| 16489 | return cbm_mcp_text_result(message, true); |
| 16490 | } |
| 16491 | |
| 16492 | static char *handle_search_code(cbm_mcp_server_t *srv, const char *args) { |
| 16493 | char *pattern = cbm_mcp_get_string_arg(args, "pattern"); |
no test coverage detected