-/* $OpenBSD: getterm.c,v 1.11 1996/09/03 16:04:57 deraadt Exp $ */
+/* $OpenBSD: getterm.c,v 1.12 1996/12/09 01:18:17 tholo Exp $ */
/*
* Copyright (c) 1996 SigmaSoft, Th. Lockert <tholo@sigmasoft.com>
*/
#ifndef lint
-static char rcsid[] = "$OpenBSD: getterm.c,v 1.11 1996/09/03 16:04:57 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: getterm.c,v 1.12 1996/12/09 01:18:17 tholo Exp $";
#endif
#include <stdlib.h>
char *s;
if ((s = home = strchr(dummy, ':')) == NULL) {
- cur_term->name = strdup(name);
+ cur_term->name = cur_term->names = strdup(name);
strncpy(ttytype, name, MAXSIZE - 1);
ttytype[MAXSIZE - 1] = '\0';
}
else {
+ int n;
+
+ n = s - dummy - (dummy[2] == '|' ? 3 : 0);
+ cur_term->names = malloc(n + 1);
+ strncpy(cur_term->names, dummy + (dummy[2] == '|' ? 3 : 0), n);
+ cur_term->names[n] = '\0';
strncpy(ttytype, dummy + (dummy[2] == '|' ? 3 : 0),
MIN(MAXSIZE - 1, s - dummy));
ttytype[MAXSIZE - 1] = '\0';
char *s;
if ((s = home = strchr(dummy, ':')) == NULL) {
- cur_term->name = strdup(name);
+ cur_term->name = cur_term->names = strdup(name);
strncpy(ttytype, name, MAXSIZE - 1);
ttytype[MAXSIZE - 1] = '\0';
}
else {
+ int n;
+
+ n = s - dummy - (dummy[2] == '|' ? 3 : 0);
+ cur_term->names = malloc(n + 1);
+ strncpy(cur_term->names, dummy + (dummy[2] == '|' ? 3 : 0), n);
+ cur_term->names[n] = '\0';
strncpy(ttytype, dummy + (dummy[2] == '|' ? 3 : 0),
MIN(MAXSIZE - 1, s - dummy));
ttytype[MAXSIZE - 1] = '\0';
-/* $OpenBSD: globals.c,v 1.3 1996/09/16 02:41:53 tholo Exp $ */
+/* $OpenBSD: globals.c,v 1.4 1996/12/09 01:18:17 tholo Exp $ */
/*
* Copyright (c) 1996 SigmaSoft, Th. Lockert <tholo@sigmasoft.com>
*/
#ifndef lint
-static char rcsid[] = "$OpenBSD: globals.c,v 1.3 1996/09/16 02:41:53 tholo Exp $";
+static char rcsid[] = "$OpenBSD: globals.c,v 1.4 1996/12/09 01:18:17 tholo Exp $";
#endif
#include "term.h"
TERMINAL _ti_empty = {
- -1, 9600, { 0 }, { 0 }, "dumb", { 0 }, { 80, 0, 24 }, { 0 }
+ -1, 9600, { 0 }, { 0 }, "dumb", "dumb", { 0 }, { 80, 0, 24 }, { 0 }
};
TERMINAL *cur_term = &_ti_empty;
-/* $OpenBSD: tgetent.c,v 1.2 1996/07/22 03:13:55 tholo Exp $ */
+/* $OpenBSD: tgetent.c,v 1.3 1996/12/09 01:18:19 tholo Exp $ */
/*
* Copyright (c) 1996 SigmaSoft, Th. Lockert <tholo@sigmasoft.com>
*/
#ifndef lint
-static char rcsid[] = "$OpenBSD: tgetent.c,v 1.2 1996/07/22 03:13:55 tholo Exp $";
+static char rcsid[] = "$OpenBSD: tgetent.c,v 1.3 1996/12/09 01:18:19 tholo Exp $";
#endif
#include <stdlib.h>
+#include <string.h>
#include <unistd.h>
#include <err.h>
#include "term.h"
char *bp;
const char *name;
{
+ char *n;
+
_ti_buf = bp;
- if (cur_term != NULL)
+ if (cur_term != NULL) {
+ for (n = strtok(cur_term->names, "|"); n != NULL; n = strtok(NULL, "|"))
+ if (strcmp(name, n) == 0)
+ return 1;
del_curterm(cur_term);
+ }
if ((cur_term = calloc(sizeof(TERMINAL), 1)) == NULL)
errx(1, "No memory for terminal description");
if (isatty(STDOUT_FILENO))