Normalise a config scalar into an indexable value: drop a YAML block-scalar header (`|`/`>` plus its chomping and indent modifiers), collapse whitespace to the shared MAX_COMMENT_LEN cap, then unquote.
| 10190 | // header (`|`/`>` plus its chomping and indent modifiers), collapse whitespace |
| 10191 | // to the shared MAX_COMMENT_LEN cap, then unquote. |
| 10192 | static const char *config_scalar_value(CBMArena *a, const char *raw) { |
| 10193 | if (!raw) { |
| 10194 | return NULL; |
| 10195 | } |
| 10196 | while (*raw == ' ' || *raw == '\t' || *raw == '\n' || *raw == '\r') { |
| 10197 | raw++; |
| 10198 | } |
| 10199 | if (*raw == '|' || *raw == '>') { |
| 10200 | while (*raw && *raw != '\n') { |
| 10201 | raw++; |
| 10202 | } |
| 10203 | } |
| 10204 | char *v = collapse_prose(a, raw, strlen(raw)); |
| 10205 | return v ? strip_surrounding_quotes(v) : NULL; |
| 10206 | } |
| 10207 | |
| 10208 | // Value of `pair` when its key is `want`, else NULL. A YAML block_mapping_pair |
| 10209 | // and a JSON pair both expose key/value fields, so one reader serves both. |
no test coverage detected