| 820 | } |
| 821 | |
| 822 | static void |
| 823 | ttydisc_rubword(struct tty *tp) |
| 824 | { |
| 825 | char c; |
| 826 | int quote, alnum; |
| 827 | |
| 828 | /* Strip whitespace first. */ |
| 829 | for (;;) { |
| 830 | if (ttyinq_peekchar(&tp->t_inq, &c, "e) != 0) |
| 831 | return; |
| 832 | if (!CTL_WHITE(c)) |
| 833 | break; |
| 834 | ttydisc_rubchar(tp); |
| 835 | } |
| 836 | |
| 837 | /* |
| 838 | * Record whether the last character from the previous iteration |
| 839 | * was alphanumeric or not. We need this to implement ALTWERASE. |
| 840 | */ |
| 841 | alnum = CTL_ALNUM(c); |
| 842 | for (;;) { |
| 843 | ttydisc_rubchar(tp); |
| 844 | |
| 845 | if (ttyinq_peekchar(&tp->t_inq, &c, "e) != 0) |
| 846 | return; |
| 847 | if (CTL_WHITE(c)) |
| 848 | return; |
| 849 | if (CMP_FLAG(l, ALTWERASE) && CTL_ALNUM(c) != alnum) |
| 850 | return; |
| 851 | } |
| 852 | } |
| 853 | |
| 854 | int |
| 855 | ttydisc_rint(struct tty *tp, char c, int flags) |
no test coverage detected