Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-6]: src/usr.bin/tset Pull up following revision(s) (requested by ...
details: https://anonhg.NetBSD.org/src/rev/dac9de33edae
branches: netbsd-6
changeset: 776994:dac9de33edae
user: bouyer <bouyer%NetBSD.org@localhost>
date: Sun Nov 15 16:33:26 2015 +0000
description:
Pull up following revision(s) (requested by mlelstv in ticket #1308):
usr.bin/tset/set.c: revision 1.18
Restore logic for setting the VERASE character.
- use terminfo _unless_ the terminal does overstrike.
- use terminfo data not only for an unset tty.
diffstat:
usr.bin/tset/set.c | 28 +++++++++++++++-------------
1 files changed, 15 insertions(+), 13 deletions(-)
diffs (50 lines):
diff -r 74117ffa9d5e -r dac9de33edae usr.bin/tset/set.c
--- a/usr.bin/tset/set.c Sun Nov 15 16:30:38 2015 +0000
+++ b/usr.bin/tset/set.c Sun Nov 15 16:33:26 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: set.c,v 1.16 2011/10/03 12:36:32 roy Exp $ */
+/* $NetBSD: set.c,v 1.16.4.1 2015/11/15 16:33:26 bouyer Exp $ */
/*-
* Copyright (c) 1991, 1993
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__RCSID("$NetBSD: set.c,v 1.16 2011/10/03 12:36:32 roy Exp $");
+__RCSID("$NetBSD: set.c,v 1.16.4.1 2015/11/15 16:33:26 bouyer Exp $");
#include <err.h>
#include <stdio.h>
@@ -151,18 +151,20 @@
void
set_control_chars(int erasechar, int intrchar, int killchar)
{
+ int bs_char;
+
+ if (key_backspace != NULL && key_backspace[1] == '\0')
+ bs_char = key_backspace[0];
+ else
+ bs_char = 0;
- if (mode.c_cc[VERASE] == 0 || erasechar != 0) {
- if (erasechar == 0) {
- if (over_strike &&
- key_backspace != NULL &&
- key_backspace[1] == '\0')
- mode.c_cc[VERASE] = key_backspace[1];
- else
- mode.c_cc[VERASE] = CERASE;
- } else
- mode.c_cc[VERASE] = erasechar;
- }
+ if (erasechar == 0 && bs_char != 0 && !over_strike)
+ erasechar = -1;
+ if (erasechar < 0)
+ erasechar = (bs_char != 0) ? bs_char : CTRL('h');
+
+ if (mode.c_cc[VERASE] == 0 || erasechar != 0)
+ mode.c_cc[VERASE] = erasechar ? erasechar : CERASE;
if (mode.c_cc[VINTR] == 0 || intrchar != 0)
mode.c_cc[VINTR] = intrchar ? intrchar : CINTR;
Home |
Main Index |
Thread Index |
Old Index