| 108 | } |
| 109 | |
| 110 | static size_t agent_occurrences(const char *text, const char *needle) { |
| 111 | size_t count = 0U; |
| 112 | size_t length = strlen(needle); |
| 113 | while (length > 0U && (text = strstr(text, needle)) != NULL) { |
| 114 | count++; |
| 115 | text += length; |
| 116 | } |
| 117 | return count; |
| 118 | } |
| 119 | |
| 120 | static int agent_write_rovo_override(const char *config_path, const char *mcp_path) { |
| 121 | size_t length = strlen("mcp:\n mcpConfigPath: \"\"\n") + strlen(mcp_path) + 1U; |