]> git.cameronkatri.com Git - mandoc.git/log
mandoc.git
8 years agoadd missing prototypes, no code change;
Ingo Schwarze [Fri, 15 Jul 2016 18:03:45 +0000 (18:03 +0000)]
add missing prototypes, no code change;
noticed by Christos Zoulas with -Wmissing-prototypes

8 years agoSanitize the environment when calling make(1) to autodetect ${CC}.
Ingo Schwarze [Fri, 15 Jul 2016 15:08:37 +0000 (15:08 +0000)]
Sanitize the environment when calling make(1) to autodetect ${CC}.
Sevan Janiyan found during testing on AIX that ${CC} could leak in.

8 years agofinal 1.13.4 release notes VERSION_1_13_4
Ingo Schwarze [Thu, 14 Jul 2016 11:09:06 +0000 (11:09 +0000)]
final 1.13.4 release notes

8 years agoAdd support for Mac OS X's sandbox_init(3) sandbox functionality, which
Kristaps Dzonsons [Tue, 12 Jul 2016 05:18:38 +0000 (05:18 +0000)]
Add support for Mac OS X's sandbox_init(3) sandbox functionality, which
is marked as DEPRECATED in OS X after 2011 or so, but has not been
removed and has no replacement.

ok schwarze@

8 years agoMake all components of the URI individually optional,
Ingo Schwarze [Mon, 11 Jul 2016 22:48:37 +0000 (22:48 +0000)]
Make all components of the URI individually optional,
independent of each other, as in:
http://man.openbsd.org[/manpath][/mansec][/arch]/name[.sec]
The restrictions in the past kept confusing people.
Triggered by a question from RafaelNeves at gmail dot com.

8 years agosupport LDFLAGS;
Ingo Schwarze [Sun, 10 Jul 2016 18:24:23 +0000 (18:24 +0000)]
support LDFLAGS;
suggested by Christian Neukirchen <chneukirchen at gmail dot com>

8 years agoOn OpenBSD, more(1) is actually less(1) with a small number of
Ingo Schwarze [Sun, 10 Jul 2016 14:05:13 +0000 (14:05 +0000)]
On OpenBSD, more(1) is actually less(1) with a small number of
compatibility features - so we can safely use more -T on OpenBSD.
But don't do that in the portable version: more -T is unlikely
to work elsewhere.
Issue reported by Svyatoslav Mishyn <juef at openmailbox dot org>.

8 years agoFix a nasty typo that prevented .so links to gziped manuals
Ingo Schwarze [Sun, 10 Jul 2016 13:34:30 +0000 (13:34 +0000)]
Fix a nasty typo that prevented .so links to gziped manuals
from working in the absence of a mandoc.db(5) database.
Found the hard way by Svyatoslav Mishyn on Crux Linux.

8 years agoSimplify the code and the server setup by deleting the pseudo-manpath
Ingo Schwarze [Sun, 10 Jul 2016 10:05:33 +0000 (10:05 +0000)]
Simplify the code and the server setup by deleting the pseudo-manpath
"mandoc" that was used for man.cgi(8) documentation and by assuming
that the apropos(1) and man.cgi(8) manuals are simply installed in
the default manpath.  Even though man.cgi(8) is not installed by
default when installing OpenBSD, it is easy to copy it into the
default manpath used for man.cgi(8).

Idea found when considering a question asked by wrant dot com.

8 years agoDo not treat PATH_INFO as a complete path if it doesn't contain
Ingo Schwarze [Sat, 9 Jul 2016 19:58:36 +0000 (19:58 +0000)]
Do not treat PATH_INFO as a complete path if it doesn't contain
a manpath.  For example, this makes http://man.openbsd.org/mandoc
work as expected.
Bug reported by tb@, reminded by Svyatoslav Mishyn.

8 years agogetopt(3) is declared in <unistd.h>, and <getopt.h> is not needed;
Ingo Schwarze [Sat, 9 Jul 2016 15:24:19 +0000 (15:24 +0000)]
getopt(3) is declared in <unistd.h>, and <getopt.h> is not needed;
from Joerg Sonnenberger via Thomas Klausner, NetBSD.

8 years agoISO C99 7.19.2.5 doesn't like mixing putchar(3) and putwchar(3) on
Ingo Schwarze [Fri, 8 Jul 2016 22:29:05 +0000 (22:29 +0000)]
ISO C99 7.19.2.5 doesn't like mixing putchar(3) and putwchar(3) on
the same stream, and actually, it fails spectacularly on glibc.
Portability issue pointed out by Svyatoslav Mishyn <juef at openmailbox
dot org> after testing on Void Linux.

8 years agoA some missing files to TESTSRCS and DISTFILES
Ingo Schwarze [Fri, 8 Jul 2016 20:46:10 +0000 (20:46 +0000)]
A some missing files to TESTSRCS and DISTFILES
and add a trivial "dist" target for convenience.

8 years agoPOSIX requires that a process calling tcsetpgrp(3) from the background
Ingo Schwarze [Fri, 8 Jul 2016 20:42:15 +0000 (20:42 +0000)]
POSIX requires that a process calling tcsetpgrp(3) from the background
gets a SIGTTOU signal.  In that case, do not stop.
Portability issue found while testing on commercial Solaris 9/10/11.
Thanks to opencsw.org for providing me with a testing environment.

8 years agosome 1.13.4 release preparations
Ingo Schwarze [Thu, 7 Jul 2016 23:46:36 +0000 (23:46 +0000)]
some 1.13.4 release preparations

8 years agoupdate developer documentation
Ingo Schwarze [Thu, 7 Jul 2016 19:19:01 +0000 (19:19 +0000)]
update developer documentation

8 years agosync with OpenBSD: do not mention mansearch(3), which is not installed,
Ingo Schwarze [Thu, 7 Jul 2016 14:35:48 +0000 (14:35 +0000)]
sync with OpenBSD: do not mention mansearch(3), which is not installed,
in a manual which is installed

8 years agosync with OpenBSD: do not talk about nginx(8)
Ingo Schwarze [Thu, 7 Jul 2016 14:34:41 +0000 (14:34 +0000)]
sync with OpenBSD: do not talk about nginx(8)

8 years agoUpdate and simplify the documentation of the -s option,
Ingo Schwarze [Fri, 1 Jul 2016 20:24:04 +0000 (20:24 +0000)]
Update and simplify the documentation of the -s option,
which was forgotten when implementing the new man.conf(5) format.
The outdated information was originally pointed out
by Andy Bradford <amb dash openbsd at bradfords dot org> on misc@.
OK jmc@

8 years agodelete two entries that are done
Ingo Schwarze [Sun, 5 Jun 2016 21:06:04 +0000 (21:06 +0000)]
delete two entries that are done

8 years agoTrim trailing whitespace from man.conf lines; patch from millert@.
Ingo Schwarze [Sat, 28 May 2016 13:44:13 +0000 (13:44 +0000)]
Trim trailing whitespace from man.conf lines; patch from millert@.

8 years agoSimplify search form: minus two visible control elements, minus
Ingo Schwarze [Sat, 28 May 2016 13:40:48 +0000 (13:40 +0000)]
Simplify search form: minus two visible control elements, minus
one table, minus twenty lines of code, no loss of functionality.
No idea why i didn't do this earlier...

8 years agoDelete useless variables that could sneak into the Makefile
Ingo Schwarze [Wed, 18 May 2016 23:51:16 +0000 (23:51 +0000)]
Delete useless variables that could sneak into the Makefile
behind the user's back, dangerously bypassing ./configure.
Leakage reported by Peter Bray <pdb_ml at yahoo dot com dot au>.

8 years agoDo not hardcode "makewhatis" in a warning message, use BINM_MAKEWHATIS.
Ingo Schwarze [Wed, 18 May 2016 22:36:00 +0000 (22:36 +0000)]
Do not hardcode "makewhatis" in a warning message, use BINM_MAKEWHATIS.
Patch from Peter Bray <pdb_ml at yahoo dot com dot au>.

8 years agoVarious people (among others Maxim Belooussov and Carsten Kunze)
Ingo Schwarze [Wed, 18 May 2016 21:37:04 +0000 (21:37 +0000)]
Various people (among others Maxim Belooussov and Carsten Kunze)
reported that the build system still assumed that ohash is only
needed if sqlite3 is also in use, which is no longer true:
The ohash library is now required no matter what.

Rework sqlite3 and ohash library autodetection
such that both work independently of each other.
Provide LDADD for additional linker flags.
Add some missing variables to configure.local.example.

8 years agoLinux needs <stddef.h>, or NULL isn't defined.
Ingo Schwarze [Wed, 18 May 2016 20:43:32 +0000 (20:43 +0000)]
Linux needs <stddef.h>, or NULL isn't defined.

8 years agoOnly focus on the query input box when no manual page is displayed,
Ingo Schwarze [Fri, 29 Apr 2016 10:45:36 +0000 (10:45 +0000)]
Only focus on the query input box when no manual page is displayed,
that is, for the index page, for the noresult page, and for the
result of an apropos(1) query with more than one page.
As noted by bentley@, when a manual page is displayed, it is more
important that people can quickly use the space bar for paging and
Ctrl-F for searching.

8 years agoSet the "autofocus" attribute on the query text box.
Ingo Schwarze [Thu, 28 Apr 2016 17:59:14 +0000 (17:59 +0000)]
Set the "autofocus" attribute on the query text box.
Patch from Fabian dot Raetz at gmail dot com.

8 years agoset up man.cgi(3) for inclusion in the web site
Ingo Schwarze [Fri, 15 Apr 2016 21:20:11 +0000 (21:20 +0000)]
set up man.cgi(3) for inclusion in the web site

8 years agodocument the internals of cgi.c for developers;
Ingo Schwarze [Fri, 15 Apr 2016 21:16:22 +0000 (21:16 +0000)]
document the internals of cgi.c for developers;
not intended to be installed

8 years agoRename five static functions to make the classification of functions
Ingo Schwarze [Fri, 15 Apr 2016 21:14:51 +0000 (21:14 +0000)]
Rename five static functions to make the classification of functions
as parsers, page generators, and result generators more obvious.
No functional change.

8 years agoprefer warn[x](3) over fprintf(3) where appropriate
Ingo Schwarze [Fri, 15 Apr 2016 16:42:52 +0000 (16:42 +0000)]
prefer warn[x](3) over fprintf(3) where appropriate

8 years agoFix parsing of PATH_INFO if both a section directory and an
Ingo Schwarze [Fri, 15 Apr 2016 15:13:07 +0000 (15:13 +0000)]
Fix parsing of PATH_INFO if both a section directory and an
architecture subdirectory are specified.  Issue reported by tb@.

8 years agoMake HTML tags lower case for better stylistic agreement with what
Ingo Schwarze [Fri, 15 Apr 2016 01:34:51 +0000 (01:34 +0000)]
Make HTML tags lower case for better stylistic agreement with what
html.c does.

8 years agoIn the architectures dropdown, move aviion, ia64, solbourne, and vax
Ingo Schwarze [Fri, 15 Apr 2016 00:51:59 +0000 (00:51 +0000)]
In the architectures dropdown, move aviion, ia64, solbourne, and vax
down to the currently unsupported entries.

8 years agoIf PATH_INFO contains a complete and correct path to a manual page
Ingo Schwarze [Fri, 15 Apr 2016 00:37:50 +0000 (00:37 +0000)]
If PATH_INFO contains a complete and correct path to a manual page
file, for example "/OpenBSD-5.9/man2/pledge.2", no database query
is needed and the file is delivered directly.

But even in this case, let's parse the PATH_INFO and fill the query
structure such that the search form at the top of the result page
gets pre-filled with useful values.

8 years agoomit list of other results when there is only one match
Ingo Schwarze [Fri, 15 Apr 2016 00:14:17 +0000 (00:14 +0000)]
omit list of other results when there is only one match

8 years agofor .Xr links, use short PATH_INFO style URIs
Ingo Schwarze [Thu, 14 Apr 2016 23:48:48 +0000 (23:48 +0000)]
for .Xr links, use short PATH_INFO style URIs

8 years agoFix a process group race.
Ingo Schwarze [Thu, 14 Apr 2016 20:55:48 +0000 (20:55 +0000)]
Fix a process group race.

It could occasionally happen that the child process spawned less(1)
before the parent process passed the control of the terminal to the
child, and in that case, less(1) sometimes complained "Stopped (tty
output)".  Issue reported by naddy@.

8 years agodo not rewrite short queries
Ingo Schwarze [Thu, 14 Apr 2016 20:40:33 +0000 (20:40 +0000)]
do not rewrite short queries

8 years agoin -man -Thtml, .nf does not preserve indentation
Ingo Schwarze [Thu, 14 Apr 2016 11:16:04 +0000 (11:16 +0000)]
in -man -Thtml, .nf does not preserve indentation

8 years agoGive manuals in purely numerical sections priority over manuals of
Ingo Schwarze [Wed, 13 Apr 2016 15:38:45 +0000 (15:38 +0000)]
Give manuals in purely numerical sections priority over manuals of
the same name in sections with an alphabetical suffix; same logic
as in main.c rev. 1.264.

8 years agoGive manuals in purely numerical sections priority over manuals of
Ingo Schwarze [Wed, 13 Apr 2016 12:26:25 +0000 (12:26 +0000)]
Give manuals in purely numerical sections priority over manuals of
the same name in sections with an alphabetical suffix (on OpenBSD,
mostly 3p), restoring behaviour of the traditional BSD man(1) that
got lost in the switch to the mandoc-based implementation.

Issue reported by jsg@, using an idea by mikeb@ for the solution,
and at least afresh1@ and jasper@ also seem in favour of the direction.

8 years agofix error page indentation:
Ingo Schwarze [Wed, 13 Apr 2016 10:19:23 +0000 (10:19 +0000)]
fix error page indentation:
negative indent for h1 only in div.section
issue reported by mikeb@

8 years agosed 's/the the/the/' in a comment; from krw@
Ingo Schwarze [Tue, 12 Apr 2016 15:30:00 +0000 (15:30 +0000)]
sed 's/the the/the/' in a comment; from krw@

8 years agodouble word; from jmc@
Ingo Schwarze [Sat, 19 Mar 2016 13:29:22 +0000 (13:29 +0000)]
double word; from jmc@

8 years agoMake the SCRIPT_NAME logic simpler, safer, and make it actually work;
Ingo Schwarze [Fri, 18 Mar 2016 13:22:27 +0000 (13:22 +0000)]
Make the SCRIPT_NAME logic simpler, safer, and make it actually work;
in part based on ideas by bentley@.
While here, improve the documentation.

8 years agodocument short URIs
Ingo Schwarze [Fri, 18 Mar 2016 01:22:56 +0000 (01:22 +0000)]
document short URIs

8 years agomake man(1) mode the default rather than apropos(1) mode
Ingo Schwarze [Thu, 17 Mar 2016 22:06:44 +0000 (22:06 +0000)]
make man(1) mode the default rather than apropos(1) mode

8 years ago'accomodate' -> 'accommodate' in a comment.
Ingo Schwarze [Thu, 17 Mar 2016 21:26:26 +0000 (21:26 +0000)]
'accomodate' -> 'accommodate' in a comment.
From krw@, started by a diff from Mical Mazurek.

8 years agosupport short URIs for man.openbsd.org
Ingo Schwarze [Thu, 17 Mar 2016 21:22:59 +0000 (21:22 +0000)]
support short URIs for man.openbsd.org

9 years agounbreak reading from stdin after recent parse() restructuring;
Ingo Schwarze [Sat, 16 Jan 2016 22:30:33 +0000 (22:30 +0000)]
unbreak reading from stdin after recent parse() restructuring;
patch from florian@

9 years agoDelete the redundant "nchild" member of struct roff_node, replacing
Ingo Schwarze [Fri, 8 Jan 2016 17:48:09 +0000 (17:48 +0000)]
Delete the redundant "nchild" member of struct roff_node, replacing
most uses by one, a few by two pointer checks, and only one by a
tiny loop - not only making data smaller, but code shorter as well.

This gets rid of an implicit invariant that confused both static
analysis tools and human auditors.  No functional change.

9 years agoPrefer warn(3) over perror(3) at the few places where it was used.
Ingo Schwarze [Fri, 8 Jan 2016 15:02:54 +0000 (15:02 +0000)]
Prefer warn(3) over perror(3) at the few places where it was used.
It is useful to see the program name, and we have err.h compat in place anyway.
Suggested by Christos Zoulas (NetBSD).

9 years agoSimplify the mparse_open() interface.
Ingo Schwarze [Fri, 8 Jan 2016 02:53:13 +0000 (02:53 +0000)]
Simplify the mparse_open() interface.
Just return the file descriptor or -1 on error;
there is just one kind of error anyway.
Suggested by Christos Zoulas (NetBSD).

9 years agoIt was very surprising that a function called mparse_readfd()
Ingo Schwarze [Fri, 8 Jan 2016 02:13:39 +0000 (02:13 +0000)]
It was very surprising that a function called mparse_readfd()
closed the file descriptor passed to it after completing its work,
in particular considering the fact that it required its callers
to call open(2) or mparse_open() beforehand.

Change mparse_readfd() to not call close(2) and change the callers
to call close(2) afterwards, more or less bringing open and close
to the same level of the code and making review easier.  Note that
man.cgi(8) already did that, even though it was wrong in the past.

Small restructuring suggested by Christos Zoulas (NetBSD).

9 years agowould be nice to warn about broken .Xr links...
Ingo Schwarze [Fri, 8 Jan 2016 01:37:32 +0000 (01:37 +0000)]
would be nice to warn about broken .Xr links...

9 years agoThe root of an .EQ tree is always EQN_ROOT, never EQN_LIST,
Ingo Schwarze [Fri, 8 Jan 2016 00:50:45 +0000 (00:50 +0000)]
The root of an .EQ tree is always EQN_ROOT, never EQN_LIST,
so delete a redundant NULL check that confused Coverity in CID 1257471;
issue reported by wiz@, patch differs from what christos@ did in NetBSD.
No functional change.

9 years agoThis code wasted memory by allocating sizeof(enum termfont *)
Ingo Schwarze [Thu, 7 Jan 2016 21:03:54 +0000 (21:03 +0000)]
This code wasted memory by allocating sizeof(enum termfont *)
where only sizeof(enum termfont) is needed.
Fixes CID 1288941.  From christos@ via wiz@, both at NetBSD.

9 years agoRecursive "define" was not detected because "lim" was never
Ingo Schwarze [Thu, 7 Jan 2016 20:19:01 +0000 (20:19 +0000)]
Recursive "define" was not detected because "lim" was never
incremented, causing infinite loops.
Fixing CID 1288962.  From christos@ via wiz@, both at NetBSD.

9 years agoImprove handling of .Va and .Vt macros.
Ingo Schwarze [Mon, 4 Jan 2016 14:44:57 +0000 (14:44 +0000)]
Improve handling of .Va and .Vt macros.
tedu@ noticed that no Vt= database entries were generated.
Serguey Parkhomovsky suggested the deletion of parse_mdoc_body().
tb@ noticed that the fix requires more than just adding TYPE_Vt
to the MDOC_Vt mask in the mdoc_handler array.

9 years agoGenerate simpler in-page links: just replace spaces with underscores.
Ingo Schwarze [Mon, 4 Jan 2016 12:45:29 +0000 (12:45 +0000)]
Generate simpler in-page links: just replace spaces with underscores.
Patch from bentley@.

9 years agoDon't retain the search query in the resulting manual links.
Ingo Schwarze [Mon, 4 Jan 2016 12:36:26 +0000 (12:36 +0000)]
Don't retain the search query in the resulting manual links.
Clean, simple URLs are best.
Patch from bentley@.

9 years agoremove NULL-checks before free(); from mmcc@
Ingo Schwarze [Wed, 23 Dec 2015 20:50:13 +0000 (20:50 +0000)]
remove NULL-checks before free(); from mmcc@

9 years agopledge(2) style:
Ingo Schwarze [Tue, 15 Dec 2015 17:38:45 +0000 (17:38 +0000)]
pledge(2) style:
Make sure to always use the idiom 'if (pledge("'
such that it can easily be searched for.
No functional change.
Requested by deraadt@ some time ago.

9 years agoNo point in trying to go on when elementary database operations
Ingo Schwarze [Thu, 26 Nov 2015 07:42:11 +0000 (07:42 +0000)]
No point in trying to go on when elementary database operations
like preparing queries or binding variables fail; that won't yield
useful results anyway but may generate huge pointless error messages.
Issue reported by deraadt@.

9 years agoFix multiple issues regarding process group and signal mask handling
Ingo Schwarze [Fri, 20 Nov 2015 21:59:54 +0000 (21:59 +0000)]
Fix multiple issues regarding process group and signal mask handling
found by tb@ and millert@; parts of the code, in particular in tag.c,
by millert@; OK millert@.

9 years agoFix an issue reported by deraadt@: When hitting Ctrl-Backslash (= SIGQUIT)
Ingo Schwarze [Sat, 14 Nov 2015 23:57:47 +0000 (23:57 +0000)]
Fix an issue reported by deraadt@:  When hitting Ctrl-Backslash (= SIGQUIT)
in the less(1) spawned by man(1), man(1) died uncleanly, leaving behind
its temp files, and killed less(1) uncleanly as well with SIGPIPE,
leaving the terminal in the wrong state.

Fix this by giving less(1) its own process group and handing it
control of the terminal, but in such a way that Ctrl-z (= SIGSTOP)
still works: In that case, let man(1) stop itself, too, and let it
continue the pager when it continues itself.

Joint work with millert@ who contributed most of the expertise
required, and also most parts of the code.
OK deraadt@ millert@

9 years agoSimplify the logic in mandoc_normdate() and add some comments.
Ingo Schwarze [Thu, 12 Nov 2015 22:44:27 +0000 (22:44 +0000)]
Simplify the logic in mandoc_normdate() and add some comments.
Also add a comment in time2a() explaining why it isn't possible
to use just one single call to strftime().
Do some style cleanup while here.
No functional change.
Triggered by a very different patch from des@FreeBSD.

9 years agoNever use LC_ALL. On the one hand, it can cause misformatting.
Ingo Schwarze [Thu, 12 Nov 2015 21:50:03 +0000 (21:50 +0000)]
Never use LC_ALL.  On the one hand, it can cause misformatting.
On the other hand, it is a security risk because it might cause
buffer overflows.  Use LC_CTYPE only, that's all we need.

9 years agomove compat_reallocarray.o into SOELIM_OBJS, no functional change
Ingo Schwarze [Sat, 7 Nov 2015 21:53:14 +0000 (21:53 +0000)]
move compat_reallocarray.o into SOELIM_OBJS, no functional change

9 years agosoelim(1) use getline(3) and err(3), and err(3) uses getprogname(3);
Ingo Schwarze [Sat, 7 Nov 2015 21:38:28 +0000 (21:38 +0000)]
soelim(1) use getline(3) and err(3), and err(3) uses getprogname(3);
found on Solaris 10 at OpenCSW

9 years agoThe sh(1) "test" builtin on Solaris 10 doesn't have -e,
Ingo Schwarze [Sat, 7 Nov 2015 21:31:22 +0000 (21:31 +0000)]
The sh(1) "test" builtin on Solaris 10 doesn't have -e,
even though that's required by POSIX.
Use -w and -r, that's just as good.

9 years agoprovide a simple stand-alone implementation of getline(3)
Ingo Schwarze [Sat, 7 Nov 2015 20:52:52 +0000 (20:52 +0000)]
provide a simple stand-alone implementation of getline(3)
for systems lacking it

9 years agoModernization, no functional change intended:
Ingo Schwarze [Sat, 7 Nov 2015 17:58:55 +0000 (17:58 +0000)]
Modernization, no functional change intended:
Use the POSIX function getline(3) rather than the slightly
dangerous BSD function fgetln(3).
Remove the related compatibility code.

9 years agoWithout HAVE_ERR, don't try to include <err.h>, it probably isn't there.
Ingo Schwarze [Sat, 7 Nov 2015 14:22:29 +0000 (14:22 +0000)]
Without HAVE_ERR, don't try to include <err.h>, it probably isn't there.
In that case, the required prototypes are in "config.h".
Patch from Peter Bray <pdb_ml at yahoo dot com dot au>.

9 years agoIn private header files, __BEGIN_DECLS and __END_DECLS are pointless.
Ingo Schwarze [Sat, 7 Nov 2015 14:01:16 +0000 (14:01 +0000)]
In private header files, __BEGIN_DECLS and __END_DECLS are pointless.
Because these work slightly differently on different systems,
they are becoming a maintenance burden in the portable version,
so delete them.

Besides, one of the chief design goals of the mandoc toolbox is to
make sure that nothing related to documentation requires C++.
Consequently, linking mandoc against any kind of C++ program would
defeat the purpose and is not supported.
I don't understand why kristaps@ added them in the first place.

9 years agogarbage collect unused EXAMPLEDIR, forgotten in the CSS cleanup;
Ingo Schwarze [Sat, 7 Nov 2015 13:14:21 +0000 (13:14 +0000)]
garbage collect unused EXAMPLEDIR, forgotten in the CSS cleanup;
noticed by Peter Bray <pdb_ml at yahoo dot com dot au>

9 years agoInstall the soelim(1) binary and manual to the right places.
Ingo Schwarze [Sat, 7 Nov 2015 13:05:14 +0000 (13:05 +0000)]
Install the soelim(1) binary and manual to the right places.
Bug reported by Peter Bray <pdb_ml at yahoo dot com dot au>.

9 years agoIn ./configure, select a RE syntax for word boundaries supported by libc;
Ingo Schwarze [Fri, 6 Nov 2015 21:19:09 +0000 (21:19 +0000)]
In ./configure, select a RE syntax for word boundaries supported by libc;
issue reported by Svyatoslav Mishyn, Peter Bray, and Daniel Levai.

9 years agomerge pledge(2) support from OpenBSD
Ingo Schwarze [Fri, 6 Nov 2015 17:33:34 +0000 (17:33 +0000)]
merge pledge(2) support from OpenBSD

9 years agoUse getprogname(3) rather than __progname.
Ingo Schwarze [Fri, 6 Nov 2015 16:30:33 +0000 (16:30 +0000)]
Use getprogname(3) rather than __progname.
Suggested by Joerg@ Sonnenberger (NetBSD).
Last year, deraadt@ confirmed on tech@ that this "has the potential
to be more portable", and micro-optimizing for speed is not relevant
here.  Also gets rid of one global variable.

9 years agoUse include files "header.html" and "footer.html" rather than a
Ingo Schwarze [Thu, 5 Nov 2015 20:55:41 +0000 (20:55 +0000)]
Use include files "header.html" and "footer.html" rather than a
compiled-in string.  This is not a security risk, we read the file
manpath.conf from the same directory, anyway.  No error handling
is needed; even if the files are absent, that's not an error.

This is more flexible without causing complication of the code or
the user interface.  It helps the upcoming revamp of the online
manual pages on man.NetBSD.org.

Based on an idea by Jean-Yves Migeon <jeanyves dot migeon at free dot fr>,
but implemented in a much simpler way.

9 years agoUnify the three stylesheets into a single CSS file.
Ingo Schwarze [Thu, 5 Nov 2015 17:47:51 +0000 (17:47 +0000)]
Unify the three stylesheets into a single CSS file.
Many thanks to bentley@ for doing this work.

9 years agodemandoc(1) needs to link against -lutil, too
Ingo Schwarze [Thu, 5 Nov 2015 17:16:34 +0000 (17:16 +0000)]
demandoc(1) needs to link against -lutil, too

9 years agoremove a stray iso-latin-1 character; noticed by bentley@
Ingo Schwarze [Thu, 5 Nov 2015 16:58:20 +0000 (16:58 +0000)]
remove a stray iso-latin-1 character; noticed by bentley@

9 years agospecify option ordering in the DESCRIPTION section;
Ingo Schwarze [Thu, 5 Nov 2015 12:06:45 +0000 (12:06 +0000)]
specify option ordering in the DESCRIPTION section;
from guenther@, ok and tweaks jmc@

9 years agoIf a .Bd block has no arguments at all, drop the block and only keep
Ingo Schwarze [Fri, 30 Oct 2015 19:04:16 +0000 (19:04 +0000)]
If a .Bd block has no arguments at all, drop the block and only keep
its contents.  Removing a gratuitious difference to groff output
found after a related bug report from krw@.

9 years agoDo not access a NULL pointer when a .Bd macro has no arguments at all.
Ingo Schwarze [Fri, 30 Oct 2015 18:53:54 +0000 (18:53 +0000)]
Do not access a NULL pointer when a .Bd macro has no arguments at all.
Bug reported by krw@.

9 years agoapply bold and italic to all non-ASCII Unicode codepoints,
Ingo Schwarze [Fri, 23 Oct 2015 14:50:58 +0000 (14:50 +0000)]
apply bold and italic to all non-ASCII Unicode codepoints,
fixing input like \fB\('e; issue reported by bentley@

9 years agouse the new function man_validate() here, too
Ingo Schwarze [Thu, 22 Oct 2015 22:06:43 +0000 (22:06 +0000)]
use the new function man_validate() here, too

9 years agomove man(7) validation into the dedicated validation phase, too
Ingo Schwarze [Thu, 22 Oct 2015 21:54:23 +0000 (21:54 +0000)]
move man(7) validation into the dedicated validation phase, too

9 years agoIf no output device was allocated because no file wanted to produce output,
Ingo Schwarze [Thu, 22 Oct 2015 21:03:43 +0000 (21:03 +0000)]
If no output device was allocated because no file wanted to produce output,
refrain from dereferencing a NULL pointer during final deallocation.
Fixing a recent regression reported by czarkoff@

9 years agoMove all mdoc(7) node validation done before child parsing
Ingo Schwarze [Wed, 21 Oct 2015 23:51:11 +0000 (23:51 +0000)]
Move all mdoc(7) node validation done before child parsing
to the new separate validation pass, except for a tiny bit
needed by the parser which goes to the new mdoc_state() module;
cleaner, simpler, and surprisingly also shorter by 15 lines.

9 years agoIn order to become able to generate syntax tree nodes on the roff(7)
Ingo Schwarze [Tue, 20 Oct 2015 02:01:31 +0000 (02:01 +0000)]
In order to become able to generate syntax tree nodes on the roff(7)
level, validation must be separated from parsing and rewinding.
This first big step moves calling of the mdoc(7) post_*() functions
out of the parser loop into their own mdoc_validate() pass, while
using a new mdoc_state() module to make syntax tree state handling
available to both the parser loop and the validation pass.

9 years agostyle cleanup, no functional change
Ingo Schwarze [Mon, 19 Oct 2015 20:04:10 +0000 (20:04 +0000)]
style cleanup, no functional change

9 years agoSimplify, no functional change:
Ingo Schwarze [Mon, 19 Oct 2015 19:51:22 +0000 (19:51 +0000)]
Simplify, no functional change:
Delete the outmdoc, outman, and outfree function pointers.

9 years agoincluding <ohash.h> requires including <stdint.h> beforehand;
Ingo Schwarze [Mon, 19 Oct 2015 18:58:47 +0000 (18:58 +0000)]
including <ohash.h> requires including <stdint.h> beforehand;
noticed by Svyatoslav Mishyn <juef at openmailbox dot org>

9 years agoVery tricky diff to fix macro interpretation and spacing around tabs
Ingo Schwarze [Sat, 17 Oct 2015 00:21:07 +0000 (00:21 +0000)]
Very tricky diff to fix macro interpretation and spacing around tabs
in .Bl -column; it took me more than a day to get this right.
Triggered by a loosely related bug report from tim@.

The lesson for you is:  Use .Ta macros in .Bl -column, avoid tabs,
or you are in for surprises:  The last word before a tab is not
interpreted as a macro (unless there is a blank in between), the
first word after a tab isn't either (unless there is a blank in
between), and a blank after a tab causes a leading blank in the
respective output cell.  Yes, "blank", "tab", "blank tab" and "tab
blank" all have different semantics; if you write code relying on
that, good luck maintaining it afterwards...

9 years agoDelete two preprocessor constants that are no longer used.
Ingo Schwarze [Thu, 15 Oct 2015 23:35:55 +0000 (23:35 +0000)]
Delete two preprocessor constants that are no longer used.
Patch from Michael Reed <m dot reed at mykolab dot com>.