=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/man/Attic/man.c,v retrieving revision 1.20 retrieving revision 1.21 diff -c -r1.20 -r1.21 *** src/usr.bin/man/Attic/man.c 2002/02/16 21:27:48 1.20 --- src/usr.bin/man/Attic/man.c 2002/09/17 19:37:39 1.21 *************** *** 1,4 **** ! /* $OpenBSD: man.c,v 1.20 2002/02/16 21:27:48 millert Exp $ */ /* $NetBSD: man.c,v 1.7 1995/09/28 06:05:34 tls Exp $ */ /* --- 1,4 ---- ! /* $OpenBSD: man.c,v 1.21 2002/09/17 19:37:39 deraadt Exp $ */ /* $NetBSD: man.c,v 1.7 1995/09/28 06:05:34 tls Exp $ */ /* *************** *** 44,50 **** #if 0 static char sccsid[] = "@(#)man.c 8.17 (Berkeley) 1/31/95"; #else ! static char rcsid[] = "$OpenBSD: man.c,v 1.20 2002/02/16 21:27:48 millert Exp $"; #endif #endif /* not lint */ --- 44,50 ---- #if 0 static char sccsid[] = "@(#)man.c 8.17 (Berkeley) 1/31/95"; #else ! static char rcsid[] = "$OpenBSD: man.c,v 1.21 2002/09/17 19:37:39 deraadt Exp $"; #endif #endif /* not lint */ *************** *** 85,93 **** sigset_t blocksigs; int ! main(argc, argv) ! int argc; ! char *argv[]; { extern char *optarg; extern int optind; --- 85,91 ---- sigset_t blocksigs; int ! main(int argc, char *argv[]) { extern char *optarg; extern int optind; *************** *** 270,286 **** if ((ep = malloc(sizeof(ENTRY))) == NULL || (ep->s = strdup(buf)) == NULL) err(1, NULL); ! /* puts it at the end, should be at the top, but then the added ! entries would be in reverse order, fix later when all are added*/ TAILQ_INSERT_TAIL(&defp->list, ep, q); ! if (e_sectp == NULL) /* save first added, to-be the new top */ e_sectp = ep; } } if (e_sectp != NULL) { /* entries added, fix order */ ! ep->q.tqe_next = defp->list.tqh_first; /* save original head */ ! defp->list.tqh_first = e_sectp; /* first added entry, new top */ ! *e_sectp->q.tqe_prev = NULL; /* terminate list */ } } /* --- 268,291 ---- if ((ep = malloc(sizeof(ENTRY))) == NULL || (ep->s = strdup(buf)) == NULL) err(1, NULL); ! /* ! * puts it at the end, should be at the top, ! * but then the added entries would be in ! * reverse order, fix later when all are added ! */ TAILQ_INSERT_TAIL(&defp->list, ep, q); ! if (e_sectp == NULL) ! /* save first added, to-be the new top */ e_sectp = ep; } } if (e_sectp != NULL) { /* entries added, fix order */ ! /* save original head */ ! ep->q.tqe_next = defp->list.tqh_first; ! /* first added entry, new top */ ! defp->list.tqh_first = e_sectp; ! /* terminate list */ ! *e_sectp->q.tqe_prev = NULL; } } /* *************** *** 529,536 **** * Build a man page for display. */ static void ! build_page(fmt, pathp) ! char *fmt, **pathp; { static int warned; ENTRY *ep; --- 534,540 ---- * Build a man page for display. */ static void ! build_page(char *fmt, char **pathp) { static int warned; ENTRY *ep; *************** *** 614,621 **** * display how information */ static void ! how(fname) ! char *fname; { FILE *fp; --- 618,624 ---- * display how information */ static void ! how(char *fname) { FILE *fp; *************** *** 661,668 **** * cat out the file */ static void ! cat(fname) ! char *fname; { int fd, n; char buf[2048]; --- 664,670 ---- * cat out the file */ static void ! cat(char *fname) { int fd, n; char buf[2048]; *************** *** 691,698 **** * check the user supplied page information */ static char * ! check_pager(name) ! char *name; { char *p, *save; --- 693,699 ---- * check the user supplied page information */ static char * ! check_pager(char *name) { char *p, *save; *************** *** 724,731 **** * strip out flag argument and jump */ static void ! jump(argv, flag, name) ! char **argv, *flag, *name; { char **arg; --- 725,731 ---- * strip out flag argument and jump */ static void ! jump(char **argv, char *flag, char *name) { char **arg; *************** *** 745,754 **** * If signaled, delete the temporary files. */ static void ! onsig(signo) ! int signo; { ! (void)cleanup(); (void)signal(signo, SIG_DFL); (void)kill(getpid(), signo); --- 745,753 ---- * If signaled, delete the temporary files. */ static void ! onsig(int signo) { ! (void)cleanup(); /* XXX signal race */ (void)signal(signo, SIG_DFL); (void)kill(getpid(), signo); *************** *** 762,768 **** * Clean up temporary files, show any error messages. */ static int ! cleanup() { TAG *intmpp, *missp; ENTRY *ep; --- 761,767 ---- * Clean up temporary files, show any error messages. */ static int ! cleanup(void) { TAG *intmpp, *missp; ENTRY *ep; *************** *** 793,799 **** * print usage message and die */ static void ! usage() { (void)fprintf(stderr, "usage: %s [-achw] [-C file] [-M path] [-m path] " "[-s section] [-S subsection] [section] title ...\n", __progname); --- 792,798 ---- * print usage message and die */ static void ! usage(void) { (void)fprintf(stderr, "usage: %s [-achw] [-C file] [-M path] [-m path] " "[-s section] [-S subsection] [section] title ...\n", __progname);