Parse search mode string (0=compact, 1=full, 2=files). */
| 9498 | |
| 9499 | /* Parse search mode string (0=compact, 1=full, 2=files). */ |
| 9500 | static int parse_search_mode(const char *mode_str) { |
| 9501 | if (!mode_str) { |
| 9502 | return 0; |
| 9503 | } |
| 9504 | if (strcmp(mode_str, "full") == 0) { |
| 9505 | return SKIP_ONE; |
| 9506 | } |
| 9507 | if (strcmp(mode_str, "files") == 0) { |
| 9508 | return MCP_RETURN_2; |
| 9509 | } |
| 9510 | return 0; |
| 9511 | } |
| 9512 | |
| 9513 | /* Validate shell-safe arguments for search. */ |
| 9514 | /* Search/grep paths and globs are ALWAYS single-quoted (POSIX sh) or |
no outgoing calls
no test coverage detected