=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/man/Attic/man.c,v retrieving revision 1.26 retrieving revision 1.27 diff -c -r1.26 -r1.27 *** src/usr.bin/man/Attic/man.c 2003/06/10 22:20:48 1.26 --- src/usr.bin/man/Attic/man.c 2003/12/16 18:58:46 1.27 *************** *** 1,4 **** ! /* $OpenBSD: man.c,v 1.26 2003/06/10 22:20:48 deraadt Exp $ */ /* $NetBSD: man.c,v 1.7 1995/09/28 06:05:34 tls Exp $ */ /* --- 1,4 ---- ! /* $OpenBSD: man.c,v 1.27 2003/12/16 18:58:46 millert Exp $ */ /* $NetBSD: man.c,v 1.7 1995/09/28 06:05:34 tls Exp $ */ /* *************** *** 40,46 **** #if 0 static char sccsid[] = "@(#)man.c 8.17 (Berkeley) 1/31/95"; #else ! static char rcsid[] = "$OpenBSD: man.c,v 1.26 2003/06/10 22:20:48 deraadt Exp $"; #endif #endif /* not lint */ --- 40,46 ---- #if 0 static char sccsid[] = "@(#)man.c 8.17 (Berkeley) 1/31/95"; #else ! static char rcsid[] = "$OpenBSD: man.c,v 1.27 2003/12/16 18:58:46 millert Exp $"; #endif #endif /* not lint */ *************** *** 159,164 **** --- 159,167 ---- if (!f_cat && !f_how && !f_where) { if (!isatty(1)) f_cat = 1; + else if ((pager = getenv("MANPAGER")) != NULL && + (*pager != '\0')) + pager = check_pager(pager); else if ((pager = getenv("PAGER")) != NULL && (*pager != '\0')) pager = check_pager(pager); else *************** *** 703,713 **** ++p; /* make sure it's "more", not "morex" */ ! if (!strncmp(p, "more", 4) && (!p[4] || isspace(p[4]))){ save = name; /* allocate space to add the "-s" */ len = strlen(save) + 1 + sizeof("-s"); ! if (!(name =malloc(len))) err(1, NULL); (void)snprintf(name, len, "%s %s", save, "-s"); } --- 706,716 ---- ++p; /* make sure it's "more", not "morex" */ ! if (!strncmp(p, "more", 4) && (p[4] == '\0' || isspace(p[4]))){ save = name; /* allocate space to add the "-s" */ len = strlen(save) + 1 + sizeof("-s"); ! if ((name = malloc(len)) == NULL) err(1, NULL); (void)snprintf(name, len, "%s %s", save, "-s"); }