]> git.cameronkatri.com Git - mandoc.git/log
mandoc.git
7 years agoPledge man.cgi(8).
Ingo Schwarze [Wed, 22 Feb 2017 16:20:01 +0000 (16:20 +0000)]
Pledge man.cgi(8).
Based on a more complicated patch from semarie@.
Sebastien and tb@ both agree with the simplification.

7 years agoSince SQLite is gone, we no longer need the "flock" pledge.
Ingo Schwarze [Wed, 22 Feb 2017 14:58:48 +0000 (14:58 +0000)]
Since SQLite is gone, we no longer need the "flock" pledge.
Patch from semarie@, OK tb@.

7 years agoHandle an odd edge case where .It is preceded by .Sm.
Ingo Schwarze [Wed, 22 Feb 2017 08:54:41 +0000 (08:54 +0000)]
Handle an odd edge case where .It is preceded by .Sm.
NULL dereference in man.cgi reported by Gabriel Guzman <gabe at
guzman dash nunez dot com> on misc@.

7 years agoDebian wants relative, not absolute symlinks for man pages;
Ingo Schwarze [Wed, 22 Feb 2017 00:00:12 +0000 (00:00 +0000)]
Debian wants relative, not absolute symlinks for man pages;
suggested by Michael Stapelberg

7 years agofix spelling error;
Ingo Schwarze [Tue, 21 Feb 2017 23:44:43 +0000 (23:44 +0000)]
fix spelling error;
found by Michael <Stapelberg at debian dot org> with Lintian

7 years agorelease 1.14.1 VERSION_1_14_1
Ingo Schwarze [Tue, 21 Feb 2017 00:37:03 +0000 (00:37 +0000)]
release 1.14.1

7 years agoresolve trivial differences with OpenBSD:
Ingo Schwarze [Sat, 18 Feb 2017 17:29:28 +0000 (17:29 +0000)]
resolve trivial differences with OpenBSD:
* we include <sys/types.h> for size_t, so we don't need <stdint.h>
* sort declarations in read_whole_file()

7 years agoadd some regress targets
Ingo Schwarze [Sat, 18 Feb 2017 15:29:39 +0000 (15:29 +0000)]
add some regress targets

7 years agopreconv_encode() can take a const input buffer;
Ingo Schwarze [Sat, 18 Feb 2017 13:43:52 +0000 (13:43 +0000)]
preconv_encode() can take a const input buffer;
diff from <christos at NetBSD>

7 years agoProvide an uninstall target, to help cleaning up after installing
Ingo Schwarze [Sat, 18 Feb 2017 13:05:43 +0000 (13:05 +0000)]
Provide an uninstall target, to help cleaning up after installing
with the wrong DESTDIR.  Use with care.

7 years agoproper test for O_DIRECTORY
Ingo Schwarze [Sat, 18 Feb 2017 12:24:24 +0000 (12:24 +0000)]
proper test for O_DIRECTORY

7 years agodouble quotes were fixed, finally
Ingo Schwarze [Sat, 18 Feb 2017 11:53:33 +0000 (11:53 +0000)]
double quotes were fixed, finally

7 years agoUse typographic quotes rather than '"' for .Rs %T (no change for -Tascii
Ingo Schwarze [Fri, 17 Feb 2017 19:15:41 +0000 (19:15 +0000)]
Use typographic quotes rather than '"' for .Rs %T (no change for -Tascii
output, of course).  Patch from bentley@ in November 2014.  This can be
committed now because groff merged Anthony's patch yesterday.

7 years agoMany people have been complaining for a long time that ``...'' looks
Ingo Schwarze [Fri, 17 Feb 2017 18:28:06 +0000 (18:28 +0000)]
Many people have been complaining for a long time that ``...'' looks
ugly in -Tascii output.  For that reason, bentley@ submitted patches
to render "..." instead to groff in November 2014 (yes, more than
two years ago).  Carsten Kunze yesterday merged them for the upcoming
groff-1.22.4 release.  Yay!

Consequently, do the same in mandoc: Render \(Lq and \(Rq (which
are used for .Do, .Dq, .Lb, and .St) as '"' in -Tascii output.
All other output modes including -Tutf8 remain unchanged.

7 years agomore tests for .IP/.nf interaction that i forgot to commit
Ingo Schwarze [Fri, 17 Feb 2017 17:43:12 +0000 (17:43 +0000)]
more tests for .IP/.nf interaction that i forgot to commit

7 years agoNo need to cast NULL when assigning it to a variable;
Ingo Schwarze [Fri, 17 Feb 2017 14:45:55 +0000 (14:45 +0000)]
No need to cast NULL when assigning it to a variable;
from Christos Zoulas <christos at NetBSD>.

7 years agoImprove clarity of some casts;
Ingo Schwarze [Fri, 17 Feb 2017 14:43:54 +0000 (14:43 +0000)]
Improve clarity of some casts;
from Christos Zoulas <christos at NetBSD>.

7 years agoMake the directory explicit where source files are located.
Ingo Schwarze [Fri, 17 Feb 2017 14:40:28 +0000 (14:40 +0000)]
Make the directory explicit where source files are located.
This is simple and seems to help the NetBSD build infrastructure.
From Christos Zoulas <christos at NetBSD>.

7 years agoBe consistent in protecting __attribute__ attributes with __;
Ingo Schwarze [Fri, 17 Feb 2017 14:31:52 +0000 (14:31 +0000)]
Be consistent in protecting __attribute__ attributes with __;
from Christos Zoulas <christos @ NetBSD>.

7 years agoFix a read buffer overrun that copied random data from memory into
Ingo Schwarze [Fri, 17 Feb 2017 03:03:03 +0000 (03:03 +0000)]
Fix a read buffer overrun that copied random data from memory into
text nodes when a string passed to deroff() ended in a backslash
and the byte after the terminating NUL was non-NUL, found by tb@
with afl(1).

Invalid bytes so copied with the high bit set could later sometimes
trigger another out of bounds read access to static memory in
roff_strdup(), so add an assertion there to abort safely in case
of similar data corruption.

7 years agoadd $(LN) configuration variable; requested by Michael <Stapelberg@debian.org>
Ingo Schwarze [Thu, 16 Feb 2017 16:09:33 +0000 (16:09 +0000)]
add $(LN) configuration variable; requested by Michael <Stapelberg@debian.org>

7 years agofix previous: stupid typo
Ingo Schwarze [Thu, 16 Feb 2017 15:19:01 +0000 (15:19 +0000)]
fix previous: stupid typo

7 years agoProvide a variable BINM_CATMAN.
Ingo Schwarze [Thu, 16 Feb 2017 15:12:32 +0000 (15:12 +0000)]
Provide a variable BINM_CATMAN.
Suggested by Michael <Stapelberg@debian.org>.

7 years agoSurprisingly, groff does not support scaling units in .Bl -column
Ingo Schwarze [Thu, 16 Feb 2017 14:38:12 +0000 (14:38 +0000)]
Surprisingly, groff does not support scaling units in .Bl -column
column width specifiers, so stop supporting them, too.
As a side effect, this fixes an assertion failure that tb@ found
with afl(1), triggered by: .Bl -column -4n

7 years agoFix rev. 1.280: -O syntax is different in default apropos(1) output
Ingo Schwarze [Thu, 16 Feb 2017 10:56:07 +0000 (10:56 +0000)]
Fix rev. 1.280: -O syntax is different in default apropos(1) output
mode and in other output modes, so do not error out prematurely.
Also sort local variables in main() while here.

7 years agoFix block scoping error if an explicit block is broken by two
Ingo Schwarze [Thu, 16 Feb 2017 09:47:31 +0000 (09:47 +0000)]
Fix block scoping error if an explicit block is broken by two
implicit blocks (.Aq Bq Po .Pc) that left the outer breaker open
and could in exceptional cases, like between .Bl and .It, cause
tree corruption leading to NULL dereference.
Found by tb@ with afl(1).

While here, do not mark intermediate ENDBODY markers as broken.

7 years agoRemove the ENDBODY_NOSPACE flag, simplifying the code.
Ingo Schwarze [Thu, 16 Feb 2017 03:00:23 +0000 (03:00 +0000)]
Remove the ENDBODY_NOSPACE flag, simplifying the code.

Comparing to groff output, it appears that all cases where it was used
and made a difference actually require the opposite, ENDBODY_SPACE.

I have no idea why i added it back in 2010; maybe to compensate for
some other bug that has long been fixed.

7 years agoStyle improvement, no functional change.
Ingo Schwarze [Wed, 15 Feb 2017 15:58:46 +0000 (15:58 +0000)]
Style improvement, no functional change.

As reported by Yuri Pankov, some versions of GCC whine that "tmp"
might be used uninitialized in fts_open(3).  Clearly, that cannot
actually happen, but explicitly setting it to NULL is safer anyway.
While here, rename the badly named variable "tmp" and make the
inner "if" easier to understand.

Feedback and OK guenther@

7 years agoFix previous: I forgot that i had to change the convention how
Ingo Schwarze [Wed, 15 Feb 2017 14:10:08 +0000 (14:10 +0000)]
Fix previous:  I forgot that i had to change the convention how
a node is marked as "not a macro" when unifying the parsers.
Confirmed to work by Sevan Janiyan.

7 years agoDo not access a NULL pointer if a matrix or square root are empty.
Ingo Schwarze [Sun, 12 Feb 2017 14:19:01 +0000 (14:19 +0000)]
Do not access a NULL pointer if a matrix or square root are empty.
Crashes found by tb@ with afl(1).

7 years agoDo not read one element past the end of the static const termacts array.
Ingo Schwarze [Sat, 11 Feb 2017 21:49:50 +0000 (21:49 +0000)]
Do not read one element past the end of the static const termacts array.
Bug found by Sevan Janiyan <venture37 at geeklan dot co dot uk>
who ran the OpenBSD mandoc test suite on Ubuntu on POWER8 (sic!)
and reported that mdoc/Sh/before.in failed in -Tman mode.
If that isn't power testing, i don't know...

7 years agonew regression tests for mdoc_macro.c revs. 1.211-1.215
Ingo Schwarze [Sat, 11 Feb 2017 20:22:35 +0000 (20:22 +0000)]
new regression tests for mdoc_macro.c revs. 1.211-1.215

7 years agoDisable three UTF-8 tests that expose bugs in wcwidth(3) in the
Ingo Schwarze [Sat, 11 Feb 2017 17:53:33 +0000 (17:53 +0000)]
Disable three UTF-8 tests that expose bugs in wcwidth(3) in the
native C libraries of illumos, Oracle Solaris 11, and SunOS 5.10.
While it is useful to catch wcwidth(3) regressions on OpenBSD, the
purpose of the *portable* mandoc regression suite is not to check
the C library of the host system; that would just hide genuine
mandoc portability issues in the noise.  The remaining UTF-8 tests
are still sufficient to establish that mandoc does the right thing.

Issues reported by Sevan Janiyan <venture37 at geeklan dot co dot uk>
after testing on OmniOS.

7 years agoNever look for broken blocks inside blocks that are already closed.
Ingo Schwarze [Sat, 11 Feb 2017 15:47:16 +0000 (15:47 +0000)]
Never look for broken blocks inside blocks that are already closed.
Fixes the last the of tree corruptions sometimes causing NULL dereference
reported by tb@; this one triggered in cases like: .Bl -column .It Pq Ta

7 years agoDo not prematurely close .Nd containing a broken child.
Ingo Schwarze [Sat, 11 Feb 2017 14:11:17 +0000 (14:11 +0000)]
Do not prematurely close .Nd containing a broken child.
Fixes tree corruption leading to NULL dereference
in insane cases like .Oo Oo .Nd .Pq Oc .Oc Oc
found by tb@ with afl(1).

7 years agoDo not prematurely mark intermediate blocks as broken while scanning
Ingo Schwarze [Sat, 11 Feb 2017 13:24:12 +0000 (13:24 +0000)]
Do not prematurely mark intermediate blocks as broken while scanning
backwards.  Only do so when a block is found that is actually broken.
Logic error found while investigating crashes reported by tb@.

7 years agoFor child macros of block-end macros, only scan backwards for pending
Ingo Schwarze [Fri, 10 Feb 2017 22:19:18 +0000 (22:19 +0000)]
For child macros of block-end macros, only scan backwards for pending
breakers unless the parent of the block is already closed.  While
the scanning is needed in cases like ".Ac Bo" for broken Ao, it is
useless and crashy in cases like ".Ac Bc" for non-broken Ao.

This fixes a NULL pointer dereference that tb@ found with afl(1).

7 years agoIn the SYNOPSIS, .Nm blocks can get broken if one of their children
Ingo Schwarze [Fri, 10 Feb 2017 16:20:34 +0000 (16:20 +0000)]
In the SYNOPSIS, .Nm blocks can get broken if one of their children
gets broken.  In that case, mark them as BROKEN and ENDED and make
sure they get closed out together with the child.

Fixes tree corruption leeding to a NULL dereference found by tb@
with afl(1) in: .Sh SYNOPSIS .Bl .Oo .Nm .Bk .Oc .It (where .Bk is
the child and .Oo is the breaker).
A simpler form of the same corruption (without crash) is visible in:
.Sh SYNOPSIS .Ao .Nm .Bo .Ac .Bc text
where the text ended up inside the .Nm (child .Bo, breaker .Ao).

7 years agoIn -Ttree output mode, show the BROKEN node flag and
Ingo Schwarze [Fri, 10 Feb 2017 15:45:28 +0000 (15:45 +0000)]
In -Ttree output mode, show the BROKEN node flag and
provide a -Onoval output option to show the unvalidated tree.

7 years agosame as mandocdb.c rev. 1.196:
Ingo Schwarze [Thu, 9 Feb 2017 20:53:33 +0000 (20:53 +0000)]
same as mandocdb.c rev. 1.196:
for portability, use (char *)NULL in execlp(3) as discussed on tech@
OpenBSD (didn't blow up anywhere yet, but better safe than sorry)

7 years agoIllumos doesn't have O_DIRECTORY. Work around that for now, may
Ingo Schwarze [Thu, 9 Feb 2017 18:46:44 +0000 (18:46 +0000)]
Illumos doesn't have O_DIRECTORY.  Work around that for now, may
fix it better after the 1.14.1 release.  Portability issue reported
by Sevan Janiyan <venture37 at geeklan dot co dot uk>.

7 years agoEscape literal braces in a regular expression.
Ingo Schwarze [Thu, 9 Feb 2017 15:34:28 +0000 (15:34 +0000)]
Escape literal braces in a regular expression.
Deprecated perlre(1) syntax reported by Thomas Klausner and Sevan Janiyan.

7 years agoOn some systems (e.g. Solaris 11) diff(1) does not support -a.
Ingo Schwarze [Wed, 8 Feb 2017 16:56:15 +0000 (16:56 +0000)]
On some systems (e.g. Solaris 11) diff(1) does not support -a.
Make it easier to get rid of it.

7 years agomention that BUILD_CATMAN doesn't work on SunOS 5.9 and 5.10
Ingo Schwarze [Wed, 8 Feb 2017 16:16:08 +0000 (16:16 +0000)]
mention that BUILD_CATMAN doesn't work on SunOS 5.9 and 5.10

7 years agoconfig glue for recvmsg(2) and CMSG_FIRSTHDR(3);
Ingo Schwarze [Wed, 8 Feb 2017 16:11:40 +0000 (16:11 +0000)]
config glue for recvmsg(2) and CMSG_FIRSTHDR(3);
needed for Solaris 11

7 years agosendmsg(3) may block, so retry
Ingo Schwarze [Wed, 8 Feb 2017 14:50:53 +0000 (14:50 +0000)]
sendmsg(3) may block, so retry

7 years agoeven catman needs libmandoc on systems not having fts
Ingo Schwarze [Wed, 8 Feb 2017 13:36:32 +0000 (13:36 +0000)]
even catman needs libmandoc on systems not having fts

7 years agoprotect <err.h> inclusion
Ingo Schwarze [Wed, 8 Feb 2017 13:34:27 +0000 (13:34 +0000)]
protect <err.h> inclusion

7 years agomore 1.14.1 release preparations
Ingo Schwarze [Wed, 8 Feb 2017 12:24:10 +0000 (12:24 +0000)]
more 1.14.1 release preparations

7 years agoreference a relevant mail for one TODO item
Ingo Schwarze [Wed, 8 Feb 2017 12:20:16 +0000 (12:20 +0000)]
reference a relevant mail for one TODO item

7 years agoremove some instances of Mdocdate
Ingo Schwarze [Wed, 8 Feb 2017 12:19:15 +0000 (12:19 +0000)]
remove some instances of Mdocdate

7 years agodisable some tests that expose wcwidth(3) differences among systems
Ingo Schwarze [Wed, 8 Feb 2017 12:18:21 +0000 (12:18 +0000)]
disable some tests that expose wcwidth(3) differences among systems

7 years agoFinally port the OpenBSD regression suite.
Ingo Schwarze [Wed, 8 Feb 2017 03:02:13 +0000 (03:02 +0000)]
Finally port the OpenBSD regression suite.
Both kristaps@ and wiz@ repeated asked for this,
literally for years.

7 years agofirst draft of NEWS for 1.14.1
Ingo Schwarze [Tue, 7 Feb 2017 01:30:26 +0000 (01:30 +0000)]
first draft of NEWS for 1.14.1

7 years agonew manual pages for catman(8) and mandocd(8)
Ingo Schwarze [Mon, 6 Feb 2017 19:04:21 +0000 (19:04 +0000)]
new manual pages for catman(8) and mandocd(8)

7 years agoPolishing:
Ingo Schwarze [Mon, 6 Feb 2017 19:02:37 +0000 (19:02 +0000)]
Polishing:
* support -Ios=
* create missing directories
* fix output file permissions
* error out on comminication failures

I now consider this good enough for a first release.
Bugs and missing features are still likely, though.

7 years agoexplicitly pass -Tascii to mandoc(1), such that LC_CTYPE does not
Ingo Schwarze [Mon, 6 Feb 2017 03:48:33 +0000 (03:48 +0000)]
explicitly pass -Tascii to mandoc(1), such that LC_CTYPE does not
get into the way, and fix the usage() while here

7 years agoThe .Nm macro does not only use the default name when it has no
Ingo Schwarze [Mon, 6 Feb 2017 03:44:58 +0000 (03:44 +0000)]
The .Nm macro does not only use the default name when it has no
argument, but also when the first argument is a child macro.
Arcane issue found in the FreeBSD cxgbetool(8) manual that Baptiste
Daroussin <bapt at FreeBSD> sent me long ago for a different reason.

While solving this, switch to the new technique of doing text
production in the validator, reducing code duplication in the
formatters, which also makes -Ttree output clearer.

7 years agouint8_t requires <stdint.h>; from Michael Stapelberg
Ingo Schwarze [Sun, 5 Feb 2017 22:51:11 +0000 (22:51 +0000)]
uint8_t requires <stdint.h>; from Michael Stapelberg

7 years agodocument output spacing near delimiters
Ingo Schwarze [Sun, 5 Feb 2017 22:30:29 +0000 (22:30 +0000)]
document output spacing near delimiters

7 years agoremove several things that were taken care of in the past
Ingo Schwarze [Sun, 5 Feb 2017 22:25:39 +0000 (22:25 +0000)]
remove several things that were taken care of in the past

7 years agoadd missing file man.options.1
Ingo Schwarze [Sun, 5 Feb 2017 22:22:46 +0000 (22:22 +0000)]
add missing file man.options.1

7 years agodocument hyphenation
Ingo Schwarze [Sun, 5 Feb 2017 21:41:21 +0000 (21:41 +0000)]
document hyphenation

7 years agoWrap .St content in a <span class="St">.
Ingo Schwarze [Sun, 5 Feb 2017 21:00:43 +0000 (21:00 +0000)]
Wrap .St content in a <span class="St">.
Also add forgotten <span class="Ux"> to .At rendering.

7 years agofix font selection for .Bf without argument
Ingo Schwarze [Sun, 5 Feb 2017 20:34:57 +0000 (20:34 +0000)]
fix font selection for .Bf without argument

7 years agomark up .Ar, .Fa, .Va, .Ft, and .Vt with <var> rather than <i>;
Ingo Schwarze [Sun, 5 Feb 2017 20:22:04 +0000 (20:22 +0000)]
mark up .Ar, .Fa, .Va, .Ft, and .Vt with <var> rather than <i>;
suggested by bentley@ long ago, but needed lots of cleanup first

7 years agofor .Rs, use <cite>
Ingo Schwarze [Sun, 5 Feb 2017 19:29:19 +0000 (19:29 +0000)]
for .Rs, use <cite>

7 years agoImprove <table> syntax:
Ingo Schwarze [Sun, 5 Feb 2017 18:15:39 +0000 (18:15 +0000)]
Improve <table> syntax:
The <col> element can only appear inside <colgroup>, so use <colgroup>.
The <tbody> element is optional and useless, so don't use it.
Even if we would ever need <thead> or <tfoot>, <tbody> would still be
optional and useless; besides, we will likely never need <thead> or <tfoot>,
simply because our languages don't support such functionality.

7 years agoexperimental mandocd(8) and catman(8)
Ingo Schwarze [Sat, 4 Feb 2017 12:03:07 +0000 (12:03 +0000)]
experimental mandocd(8) and catman(8)
for development in the tree, not yet ready for production

7 years agoDo not fix the default indent for all subsequent files; some may use
Ingo Schwarze [Sat, 4 Feb 2017 11:58:09 +0000 (11:58 +0000)]
Do not fix the default indent for all subsequent files; some may use
a different macro language and hence require a different indent.
You can see the effect with "man -a 1 host hostname".

7 years agoMinor cleanup, no functional change:
Ingo Schwarze [Fri, 3 Feb 2017 18:18:23 +0000 (18:18 +0000)]
Minor cleanup, no functional change:
We always have a roff parser, so mparse_free() does not need to check
for existence before freeing it.
Also arrange code in struct mparse, mparse_reset(), and mparse_free()
in the same order for readability.

7 years agomore work found in old mails
Ingo Schwarze [Fri, 3 Feb 2017 17:59:22 +0000 (17:59 +0000)]
more work found in old mails

7 years agoIf an application parses multiple files with mparse_readfd(3) but
Ingo Schwarze [Fri, 3 Feb 2017 17:56:59 +0000 (17:56 +0000)]
If an application parses multiple files with mparse_readfd(3) but
without using mparse_open(3) to open the files, and if one of the
files includes a gzip'ed file with .so, then the gzip flag remains
set and the next main file will be expected to be gzip'ed.
Fix this by clearing the gzip flag in mparse_reset(3).

Bug found and patch provided by Michael <Stapelberg at debian dot org>.

7 years agoeven man-1.6g does *not* have apropos -C,
Ingo Schwarze [Thu, 2 Feb 2017 20:10:51 +0000 (20:10 +0000)]
even man-1.6g does *not* have apropos -C,
maybe it is MacOS X specific, i don't know...

7 years agocorrect information about early groff (up to 1.02)
Ingo Schwarze [Thu, 2 Feb 2017 19:59:15 +0000 (19:59 +0000)]
correct information about early groff (up to 1.02)

7 years agomention groff git, and one minor fix
Ingo Schwarze [Thu, 2 Feb 2017 18:10:16 +0000 (18:10 +0000)]
mention groff git, and one minor fix

7 years agomore info about man-1.6 and man-db
Ingo Schwarze [Thu, 2 Feb 2017 16:58:53 +0000 (16:58 +0000)]
more info about man-1.6 and man-db

7 years agominor fixes
Ingo Schwarze [Thu, 2 Feb 2017 02:30:07 +0000 (02:30 +0000)]
minor fixes

7 years agonew page, not to be installed
Ingo Schwarze [Thu, 2 Feb 2017 02:17:31 +0000 (02:17 +0000)]
new page, not to be installed

7 years agoadd missing HISTORY information
Ingo Schwarze [Tue, 31 Jan 2017 19:44:04 +0000 (19:44 +0000)]
add missing HISTORY information

7 years agoRework fill mode handling for -man -Thtml.
Ingo Schwarze [Mon, 30 Jan 2017 20:24:02 +0000 (20:24 +0000)]
Rework fill mode handling for -man -Thtml.

Basically, open <pre> whenever printing text in no-fill mode and it is
not already open, and close it whenever printing something that cannot
be inside <pre>.

This fixes a crash reported by Michael <Stapelberg at debian dot org>
in the French Linux chroot(2) manual and also improves rendering
for OpenBSD pages like DPMSGetTimeouts(3) and GLwDrawingArea(3).

These changes also permitted retiring struct mhtml.

7 years agoeliminate one useless struct and one level of indirection;
Ingo Schwarze [Sun, 29 Jan 2017 14:02:41 +0000 (14:02 +0000)]
eliminate one useless struct and one level of indirection;
no functional change

7 years agoAdd a warning "new sentence, new line".
Ingo Schwarze [Sat, 28 Jan 2017 23:30:08 +0000 (23:30 +0000)]
Add a warning "new sentence, new line".
This does not attempt to pinpoint each and every offender, but
instead tries very hard to avoid false positives: Currently, there
are only two false positives in the whole OpenBSD base system.
Only do this in mdoc(7), not in man(7), because manuals written
in man(7) typically have much worse problems than this.
OK jmc@ on a previous version of the patch

7 years agoSimplify usage of print_otag() even more:
Ingo Schwarze [Sat, 28 Jan 2017 22:36:38 +0000 (22:36 +0000)]
Simplify usage of print_otag() even more:
accept NULL to skip the attribute or format.

7 years agoMANDOCERR_BADTAB no longer exists,
Ingo Schwarze [Sat, 28 Jan 2017 22:32:51 +0000 (22:32 +0000)]
MANDOCERR_BADTAB no longer exists,
and i checked that MANDOCERR_FI_TAB is used correctly.

7 years ago.Bl -column with zero columns is legal, so don't segfalt on it.
Ingo Schwarze [Sat, 28 Jan 2017 18:43:00 +0000 (18:43 +0000)]
.Bl -column with zero columns is legal, so don't segfalt on it.
Bug introduced in rev. 1.248 triggered for example in gssapi(3),
analyzed and reported by Michael <Stapelberg at debian dot org>.
Simplify the code a bit more while here.

7 years agowarn about invalid output options
Ingo Schwarze [Fri, 27 Jan 2017 13:47:10 +0000 (13:47 +0000)]
warn about invalid output options
and error out if they occur on the command line;
missing feature found in the TODO file

7 years agowarn about missing one-line description;
Ingo Schwarze [Fri, 27 Jan 2017 11:33:26 +0000 (11:33 +0000)]
warn about missing one-line description;
missing feature found in the TODO file

7 years agoParse the section number from the content of preformatted pages
Ingo Schwarze [Fri, 27 Jan 2017 01:14:47 +0000 (01:14 +0000)]
Parse the section number from the content of preformatted pages
and warn if it doesn't match the directory where the file was found.

7 years agoIf parsing a page reveals that it is neither mdoc(7) nor man(7),
Ingo Schwarze [Fri, 27 Jan 2017 01:09:14 +0000 (01:09 +0000)]
If parsing a page reveals that it is neither mdoc(7) nor man(7),
fall back to treating it as preformatted rather than treating
it as man(7) anyway.

7 years agofix base directory detection for makewhatis -t
Ingo Schwarze [Fri, 27 Jan 2017 01:04:25 +0000 (01:04 +0000)]
fix base directory detection for makewhatis -t

7 years agoAlways register names taken from file names in the names ohash.
Ingo Schwarze [Fri, 27 Jan 2017 00:56:32 +0000 (00:56 +0000)]
Always register names taken from file names in the names ohash.
Bug found by makewhatis -p crashing in mlink_check().

7 years agomore info on man(7) .Xr hyperlinking
Ingo Schwarze [Thu, 26 Jan 2017 19:32:46 +0000 (19:32 +0000)]
more info on man(7) .Xr hyperlinking

7 years agoFix -man -Thtml formatting after .nf (which has nothing to do
Ingo Schwarze [Thu, 26 Jan 2017 18:28:18 +0000 (18:28 +0000)]
Fix -man -Thtml formatting after .nf (which has nothing to do
with "literal", by the way, it means "no fill"):

* Use <pre> such that whitespace is preserved.
* Preserve lines breaks.
* For font alternating macros, avoid node recursion which required
scary juggling with the fill state.  Instead, simply print the text
children directly.

Missing feature first noticed by kristaps@ in 2011,
the again reported by afresh1@ in 2016,
and finally reported here: https://github.com/Debian/debiman/issues/21 ,
which i only found because of Shane Kerr's comment here:
https://plus.google.com/110314300533310775053/posts/H1eaw9Yskoc

7 years agoadd arm64 architecture; from deraadt@
Ingo Schwarze [Wed, 25 Jan 2017 03:49:38 +0000 (03:49 +0000)]
add arm64 architecture; from deraadt@

7 years agoImprove HTML formatting of .Bl -tag.
Ingo Schwarze [Wed, 25 Jan 2017 02:14:43 +0000 (02:14 +0000)]
Improve HTML formatting of .Bl -tag.

In particular, when using the style sheet, put the body on the same
line as the head for short heads, or on the next line for long
heads, in a way that preserves both correct indentation and correct
vertical spacing with and without -compact, and with one or more
heads per body (hi, Zaphod) - eight use cases so far - and with and
without -tag, and with and without -offset, 32 use cases grand total.

Using many ideas from zhuk@, from <David dot Dahlberg at fkie dot
fraunhofer dot de>, and from Benny Lofgren <bl dash lists at lofgren
dot biz>, and a few of my own.

This is an excellent demonstration that CSS is an extremely hostile
language, much more trapful and much harder to use than, say, C.
When matthew@ reported this in July 2014 (!), it was already a known
issue, and i no longer remember for how long.  My first serious
attempt at fixing it (in November 2015) failed miserably.  I'd love
to see simplifications of both the generated HTML code and of the
style sheet, but without breaking any of the 32 use cases, please.

7 years agobug was fixed, delete the BUGS section
Ingo Schwarze [Sat, 21 Jan 2017 02:32:39 +0000 (02:32 +0000)]
bug was fixed, delete the BUGS section

7 years agoslightly simplify header and footer styles
Ingo Schwarze [Sat, 21 Jan 2017 02:29:57 +0000 (02:29 +0000)]
slightly simplify header and footer styles

7 years agoAvoid writing constant style attributes over and over again.
Ingo Schwarze [Sat, 21 Jan 2017 02:09:51 +0000 (02:09 +0000)]
Avoid writing constant style attributes over and over again.
Move them to the style sheet.

7 years agoclean up the remaining class attributes
Ingo Schwarze [Sat, 21 Jan 2017 01:20:31 +0000 (01:20 +0000)]
clean up the remaining class attributes