Parse search mode string (0=compact, 1=full, 2=files). */
| 5022 | |
| 5023 | /* Parse search mode string (0=compact, 1=full, 2=files). */ |
| 5024 | static int parse_search_mode(const char *mode_str) { |
| 5025 | if (!mode_str) { |
| 5026 | return 0; |
| 5027 | } |
| 5028 | if (strcmp(mode_str, "full") == 0) { |
| 5029 | return SKIP_ONE; |
| 5030 | } |
| 5031 | if (strcmp(mode_str, "files") == 0) { |
| 5032 | return MCP_RETURN_2; |
| 5033 | } |
| 5034 | return 0; |
| 5035 | } |
| 5036 | |
| 5037 | /* Validate shell-safe arguments for search. */ |
| 5038 | /* Search/grep paths and globs are ALWAYS single-quoted (POSIX sh) or |
no outgoing calls
no test coverage detected