diff options
author | Thorsten Lockert <tholo@cvs.openbsd.org> | 1996-06-21 04:34:35 +0000 |
---|---|---|
committer | Thorsten Lockert <tholo@cvs.openbsd.org> | 1996-06-21 04:34:35 +0000 |
commit | c7ebc8ac7315aef58d31a7495fdab5e9309b763b (patch) | |
tree | ead4a3890cdf5bca6465e1a9de11a6fee7378dbb | |
parent | dc0fe2eb841ed6cc764c3fe8c032b3d2bc37abbc (diff) |
When truncating to long termcap entries, don't leave partial capabilities
at the end of the capability string
-rw-r--r-- | lib/libtermlib/getterm.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/libtermlib/getterm.c b/lib/libtermlib/getterm.c index fbef236b7e7..43f14afb2b4 100644 --- a/lib/libtermlib/getterm.c +++ b/lib/libtermlib/getterm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: getterm.c,v 1.4 1996/06/21 04:26:11 tholo Exp $ */ +/* $OpenBSD: getterm.c,v 1.5 1996/06/21 04:34:34 tholo Exp $ */ /* * Copyright (c) 1996 SigmaSoft, Th. Lockert <tholo@sigmasoft.com> @@ -31,7 +31,7 @@ */ #ifndef lint -static char rcsid[] = "$OpenBSD: getterm.c,v 1.4 1996/06/21 04:26:11 tholo Exp $"; +static char rcsid[] = "$OpenBSD: getterm.c,v 1.5 1996/06/21 04:34:34 tholo Exp $"; #endif #include <stdlib.h> @@ -186,6 +186,9 @@ _ti_getterm(name) if (_ti_buf) { strncpy(_ti_buf, dummy, 1023); _ti_buf[1023] = '\0'; + if ((cp = strrchr(_ti_buf, ':')) != NULL) + if (cp[1] != '\0') + cp[1] = '\0'; } UP = cursor_up; BC = backspace_if_not_bs; |