el_editmode() * Set the state of EDIT_DISABLED from the `edit' command. */
| 623 | * Set the state of EDIT_DISABLED from the `edit' command. |
| 624 | */ |
| 625 | protected int |
| 626 | /*ARGSUSED*/ |
| 627 | el_editmode(EditLine *el, int argc, const Char **argv) |
| 628 | { |
| 629 | const Char *how; |
| 630 | |
| 631 | if (argv == NULL || argc != 2 || argv[1] == NULL) |
| 632 | return -1; |
| 633 | |
| 634 | how = argv[1]; |
| 635 | if (Strcmp(how, STR("on")) == 0) { |
| 636 | el->el_flags &= ~EDIT_DISABLED; |
| 637 | tty_rawmode(el); |
| 638 | } else if (Strcmp(how, STR("off")) == 0) { |
| 639 | tty_cookedmode(el); |
| 640 | el->el_flags |= EDIT_DISABLED; |
| 641 | } |
| 642 | else { |
| 643 | (void) fprintf(el->el_errfile, "edit: Bad value `" FSTR "'.\n", |
| 644 | how); |
| 645 | return -1; |
| 646 | } |
| 647 | return 0; |
| 648 | } |
nothing calls this directly
no test coverage detected