summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2002-02-21 04:16:24 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2002-02-21 04:16:24 +0000
commit0395d46f469f6dd61a81c8e715f4e8480b972ce8 (patch)
tree151e32ec4af9416cce20cd075e46e05528d37296 /usr.bin
parent03adcd38b017d0d0b12f38d1fffdacd67be7fa55 (diff)
remove a wrapper around getenv()
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/mg/sysdef.h9
-rw-r--r--usr.bin/mg/tty.c9
-rw-r--r--usr.bin/mg/ttykbd.c4
3 files changed, 7 insertions, 15 deletions
diff --git a/usr.bin/mg/sysdef.h b/usr.bin/mg/sysdef.h
index 8c719547740..49c95e6837f 100644
--- a/usr.bin/mg/sysdef.h
+++ b/usr.bin/mg/sysdef.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: sysdef.h,v 1.10 2002/02/14 22:54:35 vincent Exp $ */
+/* $OpenBSD: sysdef.h,v 1.11 2002/02/21 04:16:23 deraadt Exp $ */
/*
* POSIX system header file
@@ -13,17 +13,14 @@
#define KBLOCK 8192 /* Kill grow. */
#define GOOD 0 /* Good exit status. */
#define SYMBLINK 1 /* Handle symbolic links */
-#define MAXPATH PATH_MAX /* Maximum length of path for chdir */
typedef int RSIZE; /* Type for file/region sizes */
typedef short KCHAR; /* Type for internal keystrokes */
#define MALLOCROUND(m) (m+=7,m&=~7) /* round up to 8 byte boundry */
-#define gettermtype() getenv("TERM") /* determine terminal type */
-
struct fileinfo {
- mode_t fi_mode;
uid_t fi_uid;
- gid_t short fi_gid;
+ gid_t fi_gid;
+ mode_t fi_mode;
};
diff --git a/usr.bin/mg/tty.c b/usr.bin/mg/tty.c
index 056f3b40a05..9c57bc5816f 100644
--- a/usr.bin/mg/tty.c
+++ b/usr.bin/mg/tty.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tty.c,v 1.15 2002/02/21 00:02:04 deraadt Exp $ */
+/* $OpenBSD: tty.c,v 1.16 2002/02/21 04:16:23 deraadt Exp $ */
/*
* Terminfo display driver
@@ -56,12 +56,7 @@ ttinit()
{
char *tv_stype, *p;
-/* system dependent function to determine terminal type, if necessary. */
-#ifndef gettermtype
- char *gettermtype();
-#endif /* gettermtype */
-
- if ((tv_stype = gettermtype()) == NULL)
+ if ((tv_stype = getenv("TERM")) == NULL)
panic("Could not determine terminal type!");
if (setupterm(tv_stype, 1, NULL)) {
diff --git a/usr.bin/mg/ttykbd.c b/usr.bin/mg/ttykbd.c
index 187724d6ee7..2e07d1b01db 100644
--- a/usr.bin/mg/ttykbd.c
+++ b/usr.bin/mg/ttykbd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ttykbd.c,v 1.9 2001/05/24 03:05:27 mickey Exp $ */
+/* $OpenBSD: ttykbd.c,v 1.10 2002/02/21 04:16:23 deraadt Exp $ */
/*
* Name: MG 2a
@@ -56,7 +56,7 @@ ttykeymapinit()
#endif /* FKEYS */
#ifndef NO_STARTUP
- if ((cp = gettermtype())) {
+ if ((cp = getenv("TERM"))) {
if (((cp = startupfile(cp)) != NULL) && (load(cp) != TRUE))
ewprintf("Error reading key initialization file");
}