term.c (28370) | term.c (48566) |
---|---|
1/*- 2 * Copyright (c) 1991, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 22 unchanged lines hidden (view full) --- 31 * SUCH DAMAGE. 32 */ 33 34#ifndef lint 35#if 0 36static char sccsid[] = "@(#)term.c 8.1 (Berkeley) 6/9/93"; 37#endif 38static const char rcsid[] = | 1/*- 2 * Copyright (c) 1991, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 22 unchanged lines hidden (view full) --- 31 * SUCH DAMAGE. 32 */ 33 34#ifndef lint 35#if 0 36static char sccsid[] = "@(#)term.c 8.1 (Berkeley) 6/9/93"; 37#endif 38static const char rcsid[] = |
39 "$Id$"; | 39 "$Id: term.c,v 1.2 1997/08/18 07:27:56 charnier Exp $"; |
40#endif /* not lint */ 41 42#include <sys/types.h> 43#include <err.h> 44#include <errno.h> 45#include <stdio.h> 46#include <stdlib.h> 47#include <string.h> --- 51 unchanged lines hidden (view full) --- 99 */ 100found: if ((p = getenv("TERMCAP")) != NULL && *p != '/') 101 unsetenv("TERMCAP"); 102 103 /* 104 * ttype now contains a pointer to the type of the terminal. 105 * If the first character is '?', ask the user. 106 */ | 40#endif /* not lint */ 41 42#include <sys/types.h> 43#include <err.h> 44#include <errno.h> 45#include <stdio.h> 46#include <stdlib.h> 47#include <string.h> --- 51 unchanged lines hidden (view full) --- 99 */ 100found: if ((p = getenv("TERMCAP")) != NULL && *p != '/') 101 unsetenv("TERMCAP"); 102 103 /* 104 * ttype now contains a pointer to the type of the terminal. 105 * If the first character is '?', ask the user. 106 */ |
107 if (ttype[0] == '?') | 107 if (ttype[0] == '?') { |
108 if (ttype[1] != '\0') 109 ttype = askuser(ttype + 1); 110 else 111 ttype = askuser(NULL); | 108 if (ttype[1] != '\0') 109 ttype = askuser(ttype + 1); 110 else 111 ttype = askuser(NULL); |
112 } |
|
112 113 /* Find the termcap entry. If it doesn't exist, ask the user. */ 114 while ((rval = tgetent(tbuf, ttype)) == 0) { 115 warnx("terminal type %s is unknown", ttype); 116 ttype = askuser(NULL); 117 } 118 if (rval == -1) 119 errx(1, "termcap: %s", strerror(errno ? errno : ENOENT)); --- 40 unchanged lines hidden --- | 113 114 /* Find the termcap entry. If it doesn't exist, ask the user. */ 115 while ((rval = tgetent(tbuf, ttype)) == 0) { 116 warnx("terminal type %s is unknown", ttype); 117 ttype = askuser(NULL); 118 } 119 if (rval == -1) 120 errx(1, "termcap: %s", strerror(errno ? errno : ENOENT)); --- 40 unchanged lines hidden --- |