diff --git a/usr.bin/su/su.c b/usr.bin/su/su.c index 555f71285959..2eef445d7115 100644 --- a/usr.bin/su/su.c +++ b/usr.bin/su/su.c @@ -42,7 +42,7 @@ static const char copyright[] = static char sccsid[] = "@(#)su.c 8.3 (Berkeley) 4/2/94"; */ static const char rcsid[] = - "$Id: su.c,v 1.12 1996/03/09 14:57:43 markm Exp $"; + "$Id: su.c,v 1.13 1996/03/11 22:14:52 markm Exp $"; #endif /* not lint */ #include @@ -293,7 +293,8 @@ main(argc, argv) cleanenv[0] = NULL; environ = cleanenv; (void)setenv("PATH", _PATH_DEFPATH, 1); - (void)setenv("TERM", p, 1); + if (p) + (void)setenv("TERM", p, 1); if (chdir(pwd->pw_dir) < 0) errx(1, "no directory"); }