summaryrefslogtreecommitdiff
path: root/usr.bin/mandoc/main.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@cvs.openbsd.org>2019-01-10 06:27:24 +0000
committerIngo Schwarze <schwarze@cvs.openbsd.org>2019-01-10 06:27:24 +0000
commit1117d572077a78a619f7ef2d44079d78518fe4ff (patch)
tree88c7be805b054f9f6ef6d117665b26337c9e02fe /usr.bin/mandoc/main.c
parent215111e59933dc568264e2fd76b2a45d2c370b56 (diff)
Initializers for file-scope static variables should be compile-time
constants, and while stderr is a compile-time constant in OpenBSD, Kelvin Sherlock <ksherlock at gmail dot com> reports that it isn't on some other systems, for example on FreeBSD or Linux. So do the initialization by calling mandoc_msg_setoutfile() from main() instead.
Diffstat (limited to 'usr.bin/mandoc/main.c')
-rw-r--r--usr.bin/mandoc/main.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.bin/mandoc/main.c b/usr.bin/mandoc/main.c
index 9870ad106f1..187496aaf84 100644
--- a/usr.bin/mandoc/main.c
+++ b/usr.bin/mandoc/main.c
@@ -1,7 +1,7 @@
-/* $OpenBSD: main.c,v 1.219 2019/01/01 08:18:06 schwarze Exp $ */
+/* $OpenBSD: main.c,v 1.220 2019/01/10 06:27:23 schwarze Exp $ */
/*
* Copyright (c) 2008-2012 Kristaps Dzonsons <kristaps@bsd.lv>
- * Copyright (c) 2010-2012, 2014-2018 Ingo Schwarze <schwarze@openbsd.org>
+ * Copyright (c) 2010-2012, 2014-2019 Ingo Schwarze <schwarze@openbsd.org>
* Copyright (c) 2010 Joerg Sonnenberger <joerg@netbsd.org>
*
* Permission to use, copy, modify, and distribute this software for any
@@ -131,6 +131,7 @@ main(int argc, char *argv[])
pid_t pager_pid, tc_pgid, man_pgid, pid;
progname = getprogname();
+ mandoc_msg_setoutfile(stderr);
if (strncmp(progname, "mandocdb", 8) == 0 ||
strncmp(progname, "makewhatis", 10) == 0)
return mandocdb(argc, argv);