el_insertstr(): * Insert string at cursorI */
| 610 | * Insert string at cursorI |
| 611 | */ |
| 612 | public int |
| 613 | FUN(el,insertstr)(EditLine *el, const Char *s) |
| 614 | { |
| 615 | size_t len; |
| 616 | |
| 617 | if (s == NULL || (len = Strlen(s)) == 0) |
| 618 | return -1; |
| 619 | if (el->el_line.lastchar + len >= el->el_line.limit) { |
| 620 | if (!ch_enlargebufs(el, len)) |
| 621 | return -1; |
| 622 | } |
| 623 | |
| 624 | c_insert(el, (int)len); |
| 625 | while (*s) |
| 626 | *el->el_line.cursor++ = *s++; |
| 627 | return 0; |
| 628 | } |
| 629 | |
| 630 | |
| 631 | /* el_deletestr(): |
nothing calls this directly
no test coverage detected