summaryrefslogtreecommitdiff
path: root/usr.bin/mail/cmd1.c
diff options
context:
space:
mode:
authorMartynas Venckus <martynas@cvs.openbsd.org>2008-07-15 19:13:26 +0000
committerMartynas Venckus <martynas@cvs.openbsd.org>2008-07-15 19:13:26 +0000
commit8c98cf2d56717b8effe65a1576fef2af96a6c51e (patch)
tree0aada54ac87cb80c5553893222a17465b388461a /usr.bin/mail/cmd1.c
parent23af302ba59948da10b50d5bda91cb50b8fff0a4 (diff)
set cp to the value of PAGER, so that type1 doesn't try to use it
uninitialized (page=1), or use wrong previously-set value of crt (page=0). ok millert@
Diffstat (limited to 'usr.bin/mail/cmd1.c')
-rw-r--r--usr.bin/mail/cmd1.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/usr.bin/mail/cmd1.c b/usr.bin/mail/cmd1.c
index da6bad2b920..87a633e0075 100644
--- a/usr.bin/mail/cmd1.c
+++ b/usr.bin/mail/cmd1.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cmd1.c,v 1.26 2007/04/03 18:01:49 martynas Exp $ */
+/* $OpenBSD: cmd1.c,v 1.27 2008/07/15 19:13:25 martynas Exp $ */
/* $NetBSD: cmd1.c,v 1.9 1997/07/09 05:29:48 mikel Exp $ */
/*-
@@ -34,7 +34,7 @@
#if 0
static const char sccsid[] = "@(#)cmd1.c 8.2 (Berkeley) 4/20/95";
#else
-static const char rcsid[] = "$OpenBSD: cmd1.c,v 1.26 2007/04/03 18:01:49 martynas Exp $";
+static const char rcsid[] = "$OpenBSD: cmd1.c,v 1.27 2008/07/15 19:13:25 martynas Exp $";
#endif
#endif /* not lint */
@@ -370,7 +370,8 @@ type1(int *msgvec, char *cmd, int doign, int page)
}
if (page || nlines > (*cp ? atoi(cp) : realscreenheight)) {
restoreterm = (tcgetattr(fileno(stdin), &tbuf) == 0);
- obuf = Popen(value("PAGER"), "w");
+ cp = value("PAGER");
+ obuf = Popen(cp, "w");
if (obuf == NULL) {
warn("%s", cp);
obuf = stdout;