summaryrefslogtreecommitdiffstats
path: root/usr.bin/mandoc/main.c
diff options
context:
space:
mode:
authorschwarze <schwarze@openbsd.org>2009-06-21 20:10:31 +0000
committerschwarze <schwarze@openbsd.org>2009-06-21 20:10:31 +0000
commit1c0a93a08abb13bc9fa45873a03c8d9dbdc93535 (patch)
treeb77720236060eab0ab0be90b1728b205951e537a /usr.bin/mandoc/main.c
parentsync to 1.7.19: update and reorder COMPATIBILITY and CAVEATS (diff)
downloadwireguard-openbsd-1c0a93a08abb13bc9fa45873a03c8d9dbdc93535.tar.xz
wireguard-openbsd-1c0a93a08abb13bc9fa45873a03c8d9dbdc93535.zip
sync to 1.7.19: the static function fstdin was called from exactly one place
and did so little that it was better merged into main()
Diffstat (limited to 'usr.bin/mandoc/main.c')
-rw-r--r--usr.bin/mandoc/main.c21
1 files changed, 6 insertions, 15 deletions
diff --git a/usr.bin/mandoc/main.c b/usr.bin/mandoc/main.c
index 7929b42e3e6..8b4d12650f7 100644
--- a/usr.bin/mandoc/main.c
+++ b/usr.bin/mandoc/main.c
@@ -1,4 +1,4 @@
-/* $Id: main.c,v 1.6 2009/06/18 23:51:12 schwarze Exp $ */
+/* $Id: main.c,v 1.7 2009/06/21 20:10:31 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
*
@@ -88,8 +88,6 @@ static int merr(void *, int, int, const char *);
static int manwarn(void *, int, int, const char *);
static int mdocwarn(void *, int, int,
enum mdoc_warn, const char *);
-static int fstdin(struct buf *, struct buf *,
- struct curparse *);
static int ffile(struct buf *, struct buf *,
const char *, struct curparse *);
static int fdesc(struct buf *, struct buf *,
@@ -151,9 +149,12 @@ main(int argc, char *argv[])
rc = 1;
- if (NULL == *argv)
- if ( ! fstdin(&blk, &ln, &curp))
+ if (NULL == *argv) {
+ curp.file = "<stdin>";
+ curp.fd = STDIN_FILENO;
+ if ( ! fdesc(&blk, &ln, &curp))
rc = 0;
+ }
while (rc && *argv) {
if ( ! ffile(&blk, &ln, *argv, &curp))
@@ -261,16 +262,6 @@ mdoc_init(struct curparse *curp)
static int
-fstdin(struct buf *blk, struct buf *ln, struct curparse *curp)
-{
-
- curp->file = "<stdin>";
- curp->fd = STDIN_FILENO;
- return(fdesc(blk, ln, curp));
-}
-
-
-static int
ffile(struct buf *blk, struct buf *ln,
const char *file, struct curparse *curp)
{