| 516 | } |
| 517 | |
| 518 | static struct splice_script_error *clean_whitespace(const tal_t *ctx, |
| 519 | struct token ***tokens_inout) |
| 520 | { |
| 521 | struct token **input = *tokens_inout; |
| 522 | struct token **tokens = tal_arr(ctx, struct token *, tal_count(input)); |
| 523 | size_t n = 0; |
| 524 | |
| 525 | for (size_t i = 0; i < tal_count(input); i++) |
| 526 | if (input[i]->type != TOK_CHAR || !is_whitespace(input[i]->c)) |
| 527 | tokens[n++] = tal_steal(tokens, input[i]); |
| 528 | |
| 529 | tal_free(input); |
| 530 | tal_resize(&tokens, n); |
| 531 | *tokens_inout = tokens; |
| 532 | return NULL; |
| 533 | } |
| 534 | |
| 535 | /* Returns point in str that starts match of suffix. */ |
| 536 | static char *find_suffix(char *str, char *suffix) |
no test coverage detected