summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartijn van Duren <martijn@cvs.openbsd.org>2016-04-19 17:23:10 +0000
committerMartijn van Duren <martijn@cvs.openbsd.org>2016-04-19 17:23:10 +0000
commit64dd966c0fa4ba46ebd1d80b8efb719abafe2797 (patch)
tree3806e0bfe194ccd1c89d70e4db0f14f85df9d295
parent6e899853c231a088109263c3688883608310dbc4 (diff)
Remove some useless code.
Minor tweak and OK schwarze@ OK tb@
-rw-r--r--usr.bin/vi/cl/cl_term.c28
1 files changed, 5 insertions, 23 deletions
diff --git a/usr.bin/vi/cl/cl_term.c b/usr.bin/vi/cl/cl_term.c
index 85ebf5d638a..d5e350ace33 100644
--- a/usr.bin/vi/cl/cl_term.c
+++ b/usr.bin/vi/cl/cl_term.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cl_term.c,v 1.22 2016/03/17 03:44:05 bentley Exp $ */
+/* $OpenBSD: cl_term.c,v 1.23 2016/04/19 17:23:09 martijn Exp $ */
/*-
* Copyright (c) 1993, 1994
@@ -40,7 +40,6 @@ typedef struct _tklist {
char *ts; /* Key's termcap string. */
char *output; /* Corresponding vi command. */
char *name; /* Name. */
- u_char value; /* Special value (for lookup). */
} TKLIST;
static TKLIST const c_tklist[] = { /* Command mappings. */
{"kil1", "O", "insert line"},
@@ -59,17 +58,14 @@ static TKLIST const c_tklist[] = { /* Command mappings. */
{"ked", "dG", "delete to end of screen"},
{"kcuf1", "l", "cursor right"},
{"kcuu1", "k", "cursor up"},
- {NULL},
+ {NULL, NULL, NULL},
};
-static TKLIST const m1_tklist[] = { /* Input mappings (lookup). */
- {NULL},
-};
-static TKLIST const m2_tklist[] = { /* Input mappings (set or delete). */
+static TKLIST const m1_tklist[] = { /* Input mappings (set or delete). */
{"kcud1", "\033ja", "cursor down"}, /* ^[ja */
{"kcub1", "\033ha", "cursor left"}, /* ^[ha */
{"kcuu1", "\033ka", "cursor up"}, /* ^[ka */
{"kcuf1", "\033la", "cursor right"}, /* ^[la */
- {NULL},
+ {NULL, NULL, NULL},
};
/*
@@ -96,22 +92,8 @@ cl_term_init(SCR *sp)
return (1);
}
- /* Input mappings needing to be looked up. */
- for (tkp = m1_tklist; tkp->name != NULL; ++tkp) {
- if ((t = tigetstr(tkp->ts)) == NULL || t == (char *)-1)
- continue;
- for (kp = keylist;; ++kp)
- if (kp->value == tkp->value)
- break;
- if (kp == NULL)
- continue;
- if (seq_set(sp, tkp->name, strlen(tkp->name), t, strlen(t),
- &kp->ch, 1, SEQ_INPUT, SEQ_NOOVERWRITE | SEQ_SCREEN))
- return (1);
- }
-
/* Input mappings that are already set or are text deletions. */
- for (tkp = m2_tklist; tkp->name != NULL; ++tkp) {
+ for (tkp = m1_tklist; tkp->name != NULL; ++tkp) {
if ((t = tigetstr(tkp->ts)) == NULL || t == (char *)-1)
continue;
/*