=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/window/Attic/ttinit.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- src/usr.bin/window/Attic/ttinit.c 1999/11/14 17:34:24 1.5 +++ src/usr.bin/window/Attic/ttinit.c 2000/04/14 18:43:34 1.6 @@ -1,4 +1,4 @@ -/* $OpenBSD: ttinit.c,v 1.5 1999/11/14 17:34:24 millert Exp $ */ +/* $OpenBSD: ttinit.c,v 1.6 2000/04/14 18:43:34 millert Exp $ */ /* $NetBSD: ttinit.c,v 1.3 1995/09/28 10:34:50 tls Exp $ */ /* @@ -41,7 +41,7 @@ #if 0 static char sccsid[] = "@(#)ttinit.c 8.1 (Berkeley) 6/6/93"; #else -static char rcsid[] = "$OpenBSD: ttinit.c,v 1.5 1999/11/14 17:34:24 millert Exp $"; +static char rcsid[] = "$OpenBSD: ttinit.c,v 1.6 2000/04/14 18:43:34 millert Exp $"; #endif #endif /* not lint */ @@ -93,16 +93,20 @@ tt_obe = tt_ob + i; /* - * Use the standard name of the terminal (i.e. the second - * name in termcap). + * Use the standard name of the terminal (i.e. the first + * non-two letter name in termcap). */ #ifdef NCURSES_VERSION wwterm = strdup(_nc_first_name(cur_term->type.term_names)); #else - for (p = wwtermcap; *p && *p != '|' && *p != ':'; p++) - ; - if (*p == '|') - p++; + if ((p = strchr(wwtermcap, '|')) && p - wwtermcap == 2) { + /* Skip the two-character short name. */ + for (p = wwtermcap; *p && *p != '|' && *p != ':'; p++) + ; + if (*p == '|') + p++; + } else + p = wwtermcap; for (q = p; *q && *q != '|' && *q != ':'; q++) ; if (q != p && (t = malloc(q - p + 1)) != 0) {