Parse search mode string (0=compact, 1=full, 2=files). */
| 15864 | |
| 15865 | /* Parse search mode string (0=compact, 1=full, 2=files). */ |
| 15866 | static int parse_search_mode(const char *mode_str) { |
| 15867 | if (!mode_str) { |
| 15868 | return 0; |
| 15869 | } |
| 15870 | if (strcmp(mode_str, "full") == 0) { |
| 15871 | return SKIP_ONE; |
| 15872 | } |
| 15873 | if (strcmp(mode_str, "files") == 0) { |
| 15874 | return MCP_RETURN_2; |
| 15875 | } |
| 15876 | return 0; |
| 15877 | } |
| 15878 | |
| 15879 | /* Validate shell-safe arguments for search. */ |
| 15880 | /* Search/grep paths and globs are ALWAYS single-quoted (POSIX sh) or |
no outgoing calls
no test coverage detected