OpenBSD CVS

CVS log for src/usr.bin/mandoc/mdoc_validate.c


[BACK] Up to [local] / src / usr.bin / mandoc

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.306 / (download) - annotate - [select for diffs], Wed Jun 8 16:29:12 2022 UTC (23 months, 1 week ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_7_5_BASE, OPENBSD_7_5, OPENBSD_7_4_BASE, OPENBSD_7_4, OPENBSD_7_3_BASE, OPENBSD_7_3, OPENBSD_7_2_BASE, OPENBSD_7_2, HEAD
Changes since 1.305: +3 -2 lines
Diff to previous 1.305 (colored)

When looking for the next block to tag, we aren't interested in children
of the current block but really want the next block instead.  This fixes
a segfault reported by Evan Silberman <evan at jklol dot net> on bugs@.

Revision 1.305 / (download) - annotate - [select for diffs], Mon Oct 4 14:18:42 2021 UTC (2 years, 7 months ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_7_1_BASE, OPENBSD_7_1
Changes since 1.304: +6 -7 lines
Diff to previous 1.304 (colored)

store the operating system name obtained from uname(3) in the adequate
struct together with similar state date rather than in a function-scope
static variable, such that it can be free(3)d in roff_man_free();
no functional change

Revision 1.304 / (download) - annotate - [select for diffs], Sun Jul 18 11:40:58 2021 UTC (2 years, 10 months ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_7_0_BASE, OPENBSD_7_0
Changes since 1.303: +2 -2 lines
Diff to previous 1.303 (colored)

Support auto-tagging for ".It Va".

This combination is somewhat rare because few libraries expose so many
global variables that they need a list to enumerate them, but when the
idiom does occur, tagging the variable names is generally useful.
For example, this helps awk(1), dc(1), make(1), rc.subr(8), ...

Missing feature reported and patch reviewed, tested, and OK'ed by kn@.

Revision 1.303 / (download) - annotate - [select for diffs], Fri Oct 30 13:24:26 2020 UTC (3 years, 6 months ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_6_9_BASE, OPENBSD_6_9
Changes since 1.302: +2 -2 lines
Diff to previous 1.302 (colored)

Promote section headers that can can be used unmodified as fragment
identifiers from TAG_WEAK to TAG_STRONG,
such that for example ...#DESCRIPTION always works.
Suggested by Aman Verma on the discuss@ list.

Revision 1.302 / (download) - annotate - [select for diffs], Sun Apr 26 21:29:45 2020 UTC (4 years ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_6_8_BASE, OPENBSD_6_8, OPENBSD_6_7_BASE, OPENBSD_6_7
Changes since 1.301: +26 -2 lines
Diff to previous 1.301 (colored)

While we do not recommend the idiom ".Fl Fl long" for long options
because it is an abuse of semantic macros for device-specific
presentational effects, this idiom is so widespread that it makes
sense to convert it to the recommended ".Fl \-long" during the
validation phase.  For example, this improves HTML formatting
in pages where authors have used the dubious .Fl Fl.

Feature suggested by Steffen Nurpmeso <steffen at sdaoden dot eu>
on freebsd-hackers.

Revision 1.301 / (download) - annotate - [select for diffs], Fri Apr 24 11:58:02 2020 UTC (4 years ago) by schwarze
Branch: MAIN
Changes since 1.300: +8 -2 lines
Diff to previous 1.300 (colored)

provide a STYLE message when mandoc knows the file name and the extension
disagrees with the section number given in the .Dt or .TH macro;
feature suggested and patch tested by jmc@

Revision 1.300 / (download) - annotate - [select for diffs], Sat Apr 18 20:28:46 2020 UTC (4 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.299: +2 -2 lines
Diff to previous 1.299 (colored)

When a .Tg is attached to a paragraph, attach the permalink
to the first word, or the first few words if they are short.

Revision 1.299 / (download) - annotate - [select for diffs], Wed Apr 8 11:54:14 2020 UTC (4 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.298: +3 -3 lines
Diff to previous 1.298 (colored)

Use a separate node->tag attribute rather than abusing the node->string
attribute for the purpose.  No functional change intended.
The purpose is to make it possible to later attach tags to text nodes.

Revision 1.298 / (download) - annotate - [select for diffs], Mon Apr 6 09:55:49 2020 UTC (4 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.297: +41 -7 lines
Diff to previous 1.297 (colored)

Support manual tagging of .Pp, .Bd, .D1, .Dl, .Bl, and .It.
In HTML output, improve the logic for writing inside permalinks:
skip them when there is no child content or when there is a risk
that the children might contain flow content.

Revision 1.297 / (download) - annotate - [select for diffs], Thu Apr 2 14:55:29 2020 UTC (4 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.296: +8 -4 lines
Diff to previous 1.296 (colored)

Copy tagged strings before marking hyphens as breakable.
For example, this makes ":tCo-processes" work in ksh(1).

Revision 1.296 / (download) - annotate - [select for diffs], Wed Apr 1 20:10:17 2020 UTC (4 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.295: +38 -24 lines
Diff to previous 1.295 (colored)

Just like we are already doing it in HTML output, automatically tag
section and subsection headers in terminal output, too.  Even though
admittedly, commands like "/SEE" and "/   Subsec" work, too, there
is no downside, and besides, with the recent improvements in the
tagging framework, implementation cost is negligible.

Revision 1.295 / (download) - annotate - [select for diffs], Fri Mar 13 00:31:05 2020 UTC (4 years, 2 months ago) by schwarze
Branch: MAIN
Changes since 1.294: +126 -74 lines
Diff to previous 1.294 (colored)

Split tagging into a validation part including prioritization
in tag.{h,c} and {mdoc,man}_validate.c
and into a formatting part including command line argument checking
in term_tag.{h,c}, html.c, and {mdoc|man}_{term|html}.c.

Immediate functional benefits include:
* Improved prioritization of automatic tags for .Em and .Sy.
* Avoiding bogus automatic tags when .Em, .Fn, or .Sy are explicitly tagged.
* Explicit tagging of .Er and .Fl now works in HTML output.
* Automatic tagging of .IP and .TP now works in HTML output.
But mainly, this patch provides clean earth to build further improvements on.

Technical changes:
* Main program: Write a tag file for ASCII and UTF-8 output only.
* All formatters: There is no more need to delay writing the tags.
* mdoc(7)+man(7) formatters: No more need for elaborate syntax tree inspection.
* HTML formatter: If available, use the "string" attribute as the tag.
* HTML formatter: New function to write permalinks, to reduce code duplication.

Style cleanup in the vicinity while here:
* mdoc(7) terminal formatter: To set up bold font for children,
defer to termp_bold_pre() rather than calling term_fontpush() manually.
* mdoc(7) terminal formatter: Garbage collect some duplicate functions.
* mdoc(7) HTML formatter: Unify <code> handling, delete redundant functions.
* Where possible, use switch statements rather than if cascades.
* Get rid of some more Yoda notation.

The necessity for such changes was first discussed with kn@, but i didn't
bother him with a request to review the resulting -673/+782 line patch.

Revision 1.294 / (download) - annotate - [select for diffs], Thu Feb 27 21:38:27 2020 UTC (4 years, 2 months ago) by schwarze
Branch: MAIN
Changes since 1.293: +45 -6 lines
Diff to previous 1.293 (colored)

Fully support explicit tagging of .Sh and .Ss.
This fixes the offset of two lines in terminal output
and this improves HTML output by putting the id= attribute
and <a> element into the respective <h1> or <h2> element rather
than writing an additional <mark> element.

To that end, introduce node flags NODE_ID (to make the node a link
target, for example by writing an HTML id= attribute or by calling
tag_put()) and NODE_HREF (to make the node a link source, used only
in HTML output, used only to write an <a class="permalink"> element).

In particular:
* In the validator, generalize the concept of the "next node"
such that it also works before .Sh and .Ss.
* If the first argument of .Tg is empty, don't forget to complain
if there are additional arguments, which will be ignored.
* In the terminal formatter, support writing of explicit tags
for all kinds of nodes, not just for .Tg.
* In deroff(), allow nodes to have an explicit string representation
even when they aren't text nodes.  Use this for explicitly tagged
section headers.  Suprisingly, this is sufficient to make HTML
output work, without explicit code changes in the HTML formatter.
* In syntax tree output, display NODE_ID and NODE_HREF.

Revision 1.293 / (download) - annotate - [select for diffs], Thu Feb 27 01:25:58 2020 UTC (4 years, 2 months ago) by schwarze
Branch: MAIN
Changes since 1.292: +70 -86 lines
Diff to previous 1.292 (colored)

Introduce the concept of nodes that are semantically transparent:
they are skipped when looking for previous or following high-level
macros.  Examples include roff(7) .ft, .ll, and .ta, mdoc(7) .Sm
and .Tg, and man(7) .DT and .PD.  Use this concept for a variety
of improved decisions in various validators and formatters.

While here,
* remove a few const qualifiers on struct arguments that caused trouble;
* get rid of some more Yoda notation in the vicinity;
* and apply some other stylistic improvements in the vicinity.

I found this class of issues while considering .Tg patches from kn@.

Revision 1.292 / (download) - annotate - [select for diffs], Sun Jan 19 17:59:01 2020 UTC (4 years, 4 months ago) by schwarze
Branch: MAIN
Changes since 1.291: +39 -2 lines
Diff to previous 1.291 (colored)

Introduce a new mdoc(7) macro .Tg ("tag") to explicitly mark a place
as defining a term.  Please only use it when automatic tagging does
not work.  Manual page authors will not be required to add the new
macro; using it remains optional.  HTML output is still rudimentary
in this version and will be polished later.

Thanks to kn@ for reminding me that i have been considering since
BSDCan 2014 whether something like this might be useful.  Given
that possibilities of making automatic tagging better are running
out and there are still several situations where automatic tagging
cannot do the job, i think the time is now ripe.

Feedback and no objection from millert@; OK espie@ inoguchi@ kn@.

Revision 1.291 / (download) - annotate - [select for diffs], Sun Jan 19 16:16:33 2020 UTC (4 years, 4 months ago) by schwarze
Branch: MAIN
Changes since 1.290: +7 -8 lines
Diff to previous 1.290 (colored)

Align to the new, sane behaviour of the groff_mdoc(7) .Dd macro:
without an argument, use the empty string, and always concatenate
all arguments, no matter their number.
This allows reducing the number of arguments of mandoc_normdate()
and some other simplifications, at the same time polishing some
error messages by adding the name of the macro in question.

Revision 1.290 / (download) - annotate - [select for diffs], Fri Sep 13 19:18:48 2019 UTC (4 years, 8 months ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_6_6_BASE, OPENBSD_6_6
Changes since 1.289: +12 -6 lines
Diff to previous 1.289 (colored)

Improve validation of function names:
1. Relax checking to accept function types of the form
"ret_type (fname)(args)" (suggested by Yuri Pankov <yuripv dot net>).
2. Tighten checking to require the closing parenthesis.

Revision 1.289 / (download) - annotate - [select for diffs], Thu Jun 27 15:05:14 2019 UTC (4 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.288: +4 -16 lines
Diff to previous 1.288 (colored)

Fix mandoc_normdate() and the way it is used.
In the past, it could return NULL but the calling code wasn't prepared
to handle that.  Make sure it always returns an allocated string.
While here, simplify the code by handling the "quick" attribute
inside mandoc_normdate() rather than at multiple callsites.

Triggered by deraadt@ pointing out
that snprintf(3) error handling was incomplete in time2a().

Revision 1.288 / (download) - annotate - [select for diffs], Wed Mar 13 18:29:26 2019 UTC (5 years, 2 months ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_6_5_BASE, OPENBSD_6_5
Changes since 1.287: +3 -3 lines
Diff to previous 1.287 (colored)

Contrary to what the NetBSD attribute(3) manual page suggests,
using __dead instead of __attribute__((__noreturn__)) actually
hinders portability rather than helping it.

Given that mandoc already uses __attribute__ in several files
and that in the portable version, ./configure already contains
rudimentary support for ignoring it on platforms that do not
support it, use __attribute__ directly.

This is expected to fix build failures that Stephen Gregoratto
<dev at sgregoratto dot me> reported from Arch and Debian Linux.

Revision 1.287 / (download) - annotate - [select for diffs], Mon Mar 11 13:19:03 2019 UTC (5 years, 2 months ago) by schwarze
Branch: MAIN
Changes since 1.286: +3 -3 lines
Diff to previous 1.286 (colored)

mark check_abort() and post_abort() as __dead;
based on a patch by Christos@ Zoulas at NetBSD

Revision 1.286 / (download) - annotate - [select for diffs], Mon Mar 4 13:01:52 2019 UTC (5 years, 2 months ago) by schwarze
Branch: MAIN
Changes since 1.285: +13 -39 lines
Diff to previous 1.285 (colored)

When the -S option is given to man(1) and the requested manual page
name is not found and the requested architecture is unknown, complain
about the architecture rather than about the manual page name:

$ man -S vax cpu
man: Unknown architecture "vax".
$ man -S sparc64 foobar
man: No entry for foobar in the manual.

Friendlier error message suggested by jmc@, who also OK'ed the patch.

Revision 1.285 / (download) - annotate - [select for diffs], Mon Mar 4 11:40:03 2019 UTC (5 years, 2 months ago) by schwarze
Branch: MAIN
Changes since 1.284: +2 -2 lines
Diff to previous 1.284 (colored)

Fix the last straggler where the struct roff_node "line" member
was abused to detect an input line break;
instead, use the NODE_LINE flag to improve robustness.

Revision 1.284 / (download) - annotate - [select for diffs], Mon Dec 31 08:38:17 2018 UTC (5 years, 4 months ago) by schwarze
Branch: MAIN
Changes since 1.283: +3 -5 lines
Diff to previous 1.283 (colored)

Use the new flag NODE_NOFILL in the validators, which is sometimes
simpler and always more robust.  In particular, move the nesting
warnings for .EX and .EE from man_state(), where they were misplaced,
to the man(7) validator.

Revision 1.283 / (download) - annotate - [select for diffs], Mon Dec 31 07:45:42 2018 UTC (5 years, 4 months ago) by schwarze
Branch: MAIN
Changes since 1.282: +3 -3 lines
Diff to previous 1.282 (colored)

Cleanup, no functional change:
Use the new parser flag ROFF_NOFILL in the mdoc(7) parser, too,
instead of the old MDOC_LITERAL, which was an alias for the
former MAN_LITERAL.

Revision 1.282 / (download) - annotate - [select for diffs], Mon Dec 31 04:55:42 2018 UTC (5 years, 4 months ago) by schwarze
Branch: MAIN
Changes since 1.281: +3 -3 lines
Diff to previous 1.281 (colored)

Cleanup, minus 15 LOC, no functional change:
Simplify the way the man(7) and mdoc(7) validators are called.
Reset the parser state with a common function before calling them.
There is no need to again reset the parser state afterwards,
the parsers are no longer used after validation.
This allows getting rid of man_node_validate() and mdoc_node_validate()
as separate functions.

Revision 1.281 / (download) - annotate - [select for diffs], Sun Dec 30 00:48:48 2018 UTC (5 years, 4 months ago) by schwarze
Branch: MAIN
Changes since 1.280: +3 -3 lines
Diff to previous 1.280 (colored)

Cleanup, no functional change:

The struct roff_man used to be a bad mixture of internal parser
state and public parsing results.  Move the public results to the
parsing result struct roff_meta, which is already public.  Move the
rest of struct roff_man to the parser-internal header roff_int.h.

Since the validators need access to the parser state, call them
from the top level parser during mparse_result() rather than from
the main programs, also reducing code duplication.

This keeps parser internal state out of thee main programs (five
in mandoc portable) and out of eight formatters.

Revision 1.280 / (download) - annotate - [select for diffs], Fri Dec 14 05:17:45 2018 UTC (5 years, 5 months ago) by schwarze
Branch: MAIN
Changes since 1.279: +159 -224 lines
Diff to previous 1.279 (colored)

Almost mechanical diff to remove the "struct mparse *" argument
from mandoc_msg(), where it is no longer used.
While here, rename mandoc_vmsg() to mandoc_msg() and retire the
old version:  There is really no point in having another function
merely to save "%s" in a few places.
Minus 140 lines of code.

Revision 1.279 / (download) - annotate - [select for diffs], Tue Dec 4 02:53:45 2018 UTC (5 years, 5 months ago) by schwarze
Branch: MAIN
Changes since 1.278: +14 -41 lines
Diff to previous 1.278 (colored)

Clean up the validation of .Pp, .PP, .sp, and .br.  Make sure all
combinations are handled, and are handled in a systematic manner.
This resolves some erratic duplicate handling, handles a number of
missing cases, and improves diagnostics in various respects.

Move validation of .br and .sp to the roff validation module
rather than doing that twice in the mdoc and man validation modules.
Move the node relinking function to the roff library where it belongs.

In validation functions, only look at the node itself, at previous
nodes, and at descendants, not at following nodes or ancestors,
such that only nodes are inspected which are already validated.

Revision 1.278 / (download) - annotate - [select for diffs], Mon Dec 3 21:00:06 2018 UTC (5 years, 5 months ago) by schwarze
Branch: MAIN
Changes since 1.277: +43 -15 lines
Diff to previous 1.277 (colored)

In the validators, translate obsolete macro aliases (Lp, Ot, LP, P)
to the standard forms (Pp, Ft, PP) up front, such that later code
does not need to look for the obsolete versions.
This reduces the risk of incomplete handling.

Revision 1.277 / (download) - annotate - [select for diffs], Fri Aug 17 20:31:52 2018 UTC (5 years, 9 months ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_6_4_BASE, OPENBSD_6_4
Changes since 1.276: +2 -2 lines
Diff to previous 1.276 (colored)

Remove more pointer arithmetic passing via regions outside the array
that is undefined according to the C standard.  Robert Elz <kre at
munnari dot oz dot au> pointed out i wasn't quite done yet.

Revision 1.276 / (download) - annotate - [select for diffs], Thu Aug 16 15:04:45 2018 UTC (5 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.275: +3 -4 lines
Diff to previous 1.275 (colored)

Do not calculate a pointer to a memory location before the beginning of
a static array.  Christos Zoulas, Robert Elz, and Andreas Gustafsson
point out that is undefined behaviour by the C standard even if we
never access the pointer.

Revision 1.275 / (download) - annotate - [select for diffs], Wed Aug 1 16:00:54 2018 UTC (5 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.274: +2 -3 lines
Diff to previous 1.274 (colored)

Fix an off-by-one string read access that could happen if an empty
string argument preceded a string argument beginning with "--".
Found by Leah Neukirchen <leah at vuxu dot org> with -Wpointer-compare.

Revision 1.274 / (download) - annotate - [select for diffs], Wed Aug 1 13:44:15 2018 UTC (5 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.273: +2 -2 lines
Diff to previous 1.273 (colored)

Avoid a read access one byte beyond the end of an allocated string
which occurred in situations like ".Fl a Cm --"; found by
Leah Neukirchen <leah at vuxu dot org> with valgrind on Void Linux.

Revision 1.273 / (download) - annotate - [select for diffs], Wed Apr 11 17:10:35 2018 UTC (6 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.272: +6 -3 lines
Diff to previous 1.272 (colored)

preserve comments before .Dd when converting mdoc(7) to man(7)
with mandoc -Tman; suggested by Thomas Klausner <wiz at NetBSD>

Revision 1.272 / (download) - annotate - [select for diffs], Thu Apr 5 09:16:45 2018 UTC (6 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.271: +3 -3 lines
Diff to previous 1.271 (colored)

use the portable \(lq and \(rq internally rather than \(Lq and \(Rq

Revision 1.271 / (download) - annotate - [select for diffs], Fri Mar 16 20:41:19 2018 UTC (6 years, 2 months ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_6_3_BASE, OPENBSD_6_3
Changes since 1.270: +3 -2 lines
Diff to previous 1.270 (colored)

Ouch, fix previous:  In the edge case of a single-character string
containing nothing but a single hyphen, the pointer got incremented
twice at one point, causing a read overrun found by naddy@.

Revision 1.270 / (download) - annotate - [select for diffs], Fri Mar 16 15:05:33 2018 UTC (6 years, 2 months ago) by schwarze
Branch: MAIN
Changes since 1.269: +66 -9 lines
Diff to previous 1.269 (colored)

Style message about bad input encoding of em-dashes as -- instead of \(em.
Suggested by Thomas Klausner <wiz at NetBSD>; discussed with jmc@.

Revision 1.269 / (download) - annotate - [select for diffs], Tue Feb 6 16:28:26 2018 UTC (6 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.268: +9 -10 lines
Diff to previous 1.268 (colored)

Delete the "no blank before trailing delimiter" check from the
partial explicit macros.  Leah Neukirchen <leah at vuxu dot org>
rightfully points out that the check makes no sense for these macros.

Revision 1.268 / (download) - annotate - [select for diffs], Tue Sep 12 18:20:32 2017 UTC (6 years, 8 months ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_6_2_BASE, OPENBSD_6_2
Changes since 1.267: +5 -2 lines
Diff to previous 1.267 (colored)

Do not segfault when there are two .Dt macros, the first without
an architecture argument and the second with an invalid one.
Bug found by jsg@ with afl(1).

Revision 1.267 / (download) - annotate - [select for diffs], Wed Aug 2 13:28:35 2017 UTC (6 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.266: +3 -6 lines
Diff to previous 1.266 (colored)

No longer use names that only occur in the SYNOPSIS section as names
for man(1) lookup.  For OpenBSD base and Xenocara, that functionality
was never intended to be required, and i just fixed the last handful
of offenders using it - not counting the horribly ill-designed
interfaces engine(3) and lh_new(3) which are impossible to properly
document in the first place.

Of course, apropos(1) and whatis(1) continue to use SYNOPSIS .Nm,
.Fn, and .Fo macros, so "man -k ENGINE_get_load_privkey_function"
still works.

This change also gets rid of a few bogus warnings "cross reference
to self" which actually are *not* to self, like in yp(8).

This former functionality was intended to help third-party software
in the ports tree and on non-OpenBSD systems containing manual pages
with incomplete or corrupt NAME sections.  But it turned out it did
more harm than good, and caused more confusion than relief,
specifically for third party manuals and for maintainers of
mandoc-portable on other operating systems.  So kill it.
Problems reported, among others, by Yuri Pankov (illumos).

OK jmc@

Revision 1.266 / (download) - annotate - [select for diffs], Mon Jul 31 15:18:59 2017 UTC (6 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.265: +2 -2 lines
Diff to previous 1.265 (colored)

Fix an out of bounds read access to a constant array that caused
segfaults on certain hardened versions of glibc.  Triggered by .sp
or blank lines right before .SS or .SH, or before the first .Sh.
Found the hard way by Dr. Markus Waldner on Debian
and by Leah Neukirchen on Void Linux.

Revision 1.265 / (download) - annotate - [select for diffs], Thu Jul 20 12:53:55 2017 UTC (6 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.264: +16 -1 lines
Diff to previous 1.264 (colored)

correctly handle letters in .Nx arguments; improves for example
getpgid(2), ac(8), ldconfig(8), mount_ffs(8), sa(8), ttyflags(8), ...

Revision 1.264 / (download) - annotate - [select for diffs], Sat Jul 15 16:40:23 2017 UTC (6 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.263: +6 -5 lines
Diff to previous 1.263 (colored)

If -column, -diag, -inset, -item, or -ohang lists have a -width,
don't just talk about ignoring it, actually do ignore it.
No change for terminal output, improves HTML output.

Revision 1.263 / (download) - annotate - [select for diffs], Mon Jul 3 17:33:01 2017 UTC (6 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.262: +95 -49 lines
Diff to previous 1.262 (colored)

report trailing delimiters after macros where they are usually a mistake;
the idea came up in a discussion with Thomas Klausner <wiz at NetBSD>

Revision 1.262 / (download) - annotate - [select for diffs], Sun Jul 2 15:31:48 2017 UTC (6 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.261: +13 -3 lines
Diff to previous 1.261 (colored)

add warning "cross reference to self"; inspired by mdoclint

Revision 1.261 / (download) - annotate - [select for diffs], Sat Jul 1 09:47:23 2017 UTC (6 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.260: +6 -2 lines
Diff to previous 1.260 (colored)

Basic reporting of .Xrs to manual pages that don't exist
in the base system, inspired by mdoclint(1).

We are able to do this because (1) the -mdoc parser, the -Tlint validator,
and the man(1) manual page lookup code are all in the same program
and (2) the mandoc.db(5) database format allows fast lookup.

Feedback from, previous versions tested by, and OK jmc@.

A few features will be added to this in the tree, step by step.

Revision 1.260 / (download) - annotate - [select for diffs], Thu Jun 29 15:21:46 2017 UTC (6 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.259: +20 -5 lines
Diff to previous 1.259 (colored)

warn about some non-portable idioms in .Bl -column;
triggered by a question from Yuri Pankov (illumos)

Revision 1.259 / (download) - annotate - [select for diffs], Tue Jun 27 12:17:35 2017 UTC (6 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.258: +6 -3 lines
Diff to previous 1.258 (colored)

warn about .Ns macros that have no effect because they are followed
by an isolated closing delimiter; inspired by mdoclint

Revision 1.258 / (download) - annotate - [select for diffs], Sun Jun 25 17:42:37 2017 UTC (6 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.257: +63 -2 lines
Diff to previous 1.257 (colored)

Catch typos in .Sh names; suggested by jmc@.

I'm using a very simple, linear time / zero space fuzzy string
matching heuristic rather than a full Levenshtein metric, to keep
the code both simple and fast.

Revision 1.257 / (download) - annotate - [select for diffs], Sat Jun 24 18:58:09 2017 UTC (6 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.256: +40 -1 lines
Diff to previous 1.256 (colored)

operating system dependent message about unknown architecture;
inspired by mdoclint

Revision 1.256 / (download) - annotate - [select for diffs], Sat Jun 24 15:59:28 2017 UTC (6 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.255: +8 -1 lines
Diff to previous 1.255 (colored)

in the base system, suggest leaving .Os blank; inspired by mdoclint

Revision 1.255 / (download) - annotate - [select for diffs], Sat Jun 24 14:38:27 2017 UTC (6 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.254: +21 -15 lines
Diff to previous 1.254 (colored)

Split -Wstyle into -Wstyle and the even lower -Wbase, and add
-Wopenbsd and -Wnetbsd to check conventions for the base system of
a specific operating system.  Mark operating system specific messages
with "(OpenBSD)" at the end.

Please use just "-Tlint" to check base system manuals (defaulting
to -Wall, which is now -Wbase), but prefer "-Tlint -Wstyle" for the
manuals of portable software projects you maintain that are not
part of OpenBSD base, to avoid bogus recommendations about base
system conventions that do not apply.

Issue originally reported by semarie@, solution using
an idea from tedu@, discussed with jmc@ and jca@.

Revision 1.254 / (download) - annotate - [select for diffs], Sat Jun 17 22:40:27 2017 UTC (6 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.253: +5 -2 lines
Diff to previous 1.253 (colored)

style message about missing RCS ids; inspired by mdoclint

Revision 1.253 / (download) - annotate - [select for diffs], Sun Jun 11 20:02:48 2017 UTC (6 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.252: +2 -2 lines
Diff to previous 1.252 (colored)

ooops, fix a glitch in the previous commit...

Revision 1.252 / (download) - annotate - [select for diffs], Sun Jun 11 19:36:31 2017 UTC (6 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.251: +28 -6 lines
Diff to previous 1.251 (colored)

Style message about legacy man(7) date format in mdoc(7) documents
and operating system dependent messages about missing or unexpected
Mdocdate; inspired by mdoclint(1).

Revision 1.251 / (download) - annotate - [select for diffs], Sun Jun 11 17:16:36 2017 UTC (6 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.250: +25 -8 lines
Diff to previous 1.250 (colored)

style message about missing .Fn markup; inspired by mdoclint

Revision 1.250 / (download) - annotate - [select for diffs], Sun Jun 11 14:10:24 2017 UTC (6 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.249: +4 -4 lines
Diff to previous 1.249 (colored)

Do not issue the message "no blank before trailing delimiter" for .No.
In practice, that message only matters inside .Bf, and even there, it
can occasionally be a false positive.  In all other cases, it usually
is a false positive, so it is better to drop it outright.
Suggested by jmc@.

Revision 1.249 / (download) - annotate - [select for diffs], Sat Jun 10 16:53:58 2017 UTC (6 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.248: +76 -3 lines
Diff to previous 1.248 (colored)

Reduce false positives for the "no blank before trailing delimiter" message.
This brings us down to one false positive for about every 18 pages.

Revision 1.248 / (download) - annotate - [select for diffs], Sat Jun 10 01:48:31 2017 UTC (6 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.247: +75 -39 lines
Diff to previous 1.247 (colored)

style message about missing blank before trailing delimiter;
inspired by mdoclint(1), and jmc@ considers it useful

Revision 1.247 / (download) - annotate - [select for diffs], Wed Jun 7 23:29:31 2017 UTC (6 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.246: +37 -3 lines
Diff to previous 1.246 (colored)

style checks related to .Er; inspired by mdoclint(1)

Revision 1.246 / (download) - annotate - [select for diffs], Thu Jun 1 15:24:41 2017 UTC (6 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.245: +7 -1 lines
Diff to previous 1.245 (colored)

STYLE message about full stop at the end of .Nd; inspired by mdoclint(1)

Revision 1.245 / (download) - annotate - [select for diffs], Wed May 31 15:30:12 2017 UTC (6 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.244: +33 -1 lines
Diff to previous 1.244 (colored)

STYLE message about missing use of Ox/Nx/Fx/Dx; OK jmc@ wiz@

Revision 1.244 / (download) - annotate - [select for diffs], Tue May 30 19:29:31 2017 UTC (6 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.243: +14 -2 lines
Diff to previous 1.243 (colored)

STYLE message about useless macros we don't want (Bt Tn Ud);
not a WARNING because they don't endanger portability

Revision 1.243 / (download) - annotate - [select for diffs], Sun May 14 13:59:53 2017 UTC (7 years ago) by schwarze
Branch: MAIN
Changes since 1.242: +2 -2 lines
Diff to previous 1.242 (colored)

warn about punctuation between .Xr and .Rs in SEE ALSO;
inspired by mdoclint

Revision 1.242 / (download) - annotate - [select for diffs], Fri May 5 15:16:25 2017 UTC (7 years ago) by schwarze
Branch: MAIN
Changes since 1.241: +5 -5 lines
Diff to previous 1.241 (colored)

Move .sp to the roff modules.  Enough infrastructure is in place
now that this actually saves code: -70 LOC.

Revision 1.241 / (download) - annotate - [select for diffs], Fri May 5 13:17:04 2017 UTC (7 years ago) by schwarze
Branch: MAIN
Changes since 1.240: +1 -2 lines
Diff to previous 1.240 (colored)

move .ll to the roff modules

Revision 1.240 / (download) - annotate - [select for diffs], Fri May 5 02:06:17 2017 UTC (7 years ago) by schwarze
Branch: MAIN
Changes since 1.239: +3 -2 lines
Diff to previous 1.239 (colored)

Move handling of the roff(7) .ft request from the man(7)
modules to the new roff(7) modules.  As a side effect,
mdoc(7) now handles .ft, too.  Of course, do not use that.

Revision 1.239 / (download) - annotate - [select for diffs], Thu May 4 17:48:24 2017 UTC (7 years ago) by schwarze
Branch: MAIN
Changes since 1.238: +18 -7 lines
Diff to previous 1.238 (colored)

Parser reorg:
Generate the first node on the roff level: .br
Fix some column numbers in diagnostic messages while here.

Revision 1.238 / (download) - annotate - [select for diffs], Sat Apr 29 12:43:55 2017 UTC (7 years ago) by schwarze
Branch: MAIN
Changes since 1.237: +8 -8 lines
Diff to previous 1.237 (colored)

Parser unification: use nice ohashes for all three request and macro tables;
no functional change, minus two source files, minus 200 lines of code.

Revision 1.237 / (download) - annotate - [select for diffs], Fri Apr 28 16:23:30 2017 UTC (7 years ago) by schwarze
Branch: MAIN
Changes since 1.236: +4 -1 lines
Diff to previous 1.236 (colored)

Delete .Pp right before the first .Sh and right before any .Ss,
and warn about it; mdoclint(1) does so, and it makes sense.

Revision 1.236 / (download) - annotate - [select for diffs], Mon Apr 24 23:06:09 2017 UTC (7 years ago) by schwarze
Branch: MAIN
Changes since 1.235: +37 -42 lines
Diff to previous 1.235 (colored)

Continue parser unification:
* Make enum rofft an internal interface as enum roff_tok in "roff.h".
* Represent mdoc and man macros in enum roff_tok.
* Make TOKEN_NONE a proper enum value and use it throughout.
* Put the prologue macros first in the macro tables.
* Unify mdoc_macroname[] and man_macroname[] into roff_name[].

Revision 1.235 / (download) - annotate - [select for diffs], Mon Mar 6 17:25:24 2017 UTC (7 years, 2 months ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_6_1_BASE, OPENBSD_6_1
Changes since 1.234: +5 -1 lines
Diff to previous 1.234 (colored)

Using .Nd only makes sense in the NAME section.
Warn if that macro occurs elsewhere.
Triggered by a question from Dag-Erling Smoergrav <des @ FreeBSD>.

Revision 1.234 / (download) - annotate - [select for diffs], Mon Feb 6 03:41:44 2017 UTC (7 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.233: +11 -1 lines
Diff to previous 1.233 (colored)

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.

Revision 1.233 / (download) - annotate - [select for diffs], Wed Jan 11 17:39:45 2017 UTC (7 years, 4 months ago) by schwarze
Branch: MAIN
Changes since 1.232: +178 -75 lines
Diff to previous 1.232 (colored)

Do text production for .Bt, .Ex, .Rv, .Ud at the validation stage
rather than in the formatters.  Use NODE_NOSRC flag for .Lb and
NODE_NOSRC and NODE_NOPRT for .St.  Results in a more rigorous
syntax tree and in 135 lines less code.

This work was triggered by a question from Abhinav Upadhyay <er dot
abhinav dot upadhyay at gmail dot com> (NetBSD) on discuss@.

Revision 1.232 / (download) - annotate - [select for diffs], Tue Jan 10 23:36:24 2017 UTC (7 years, 4 months ago) by schwarze
Branch: MAIN
Changes since 1.231: +46 -22 lines
Diff to previous 1.231 (colored)

Use new NODE_NOSRC and NODE_NOPRT flags for .Bx and .At.
More rigorous AST and 40 lines less code.

Revision 1.231 / (download) - annotate - [select for diffs], Tue Jan 10 21:54:34 2017 UTC (7 years, 4 months ago) by schwarze
Branch: MAIN
Changes since 1.230: +43 -7 lines
Diff to previous 1.230 (colored)

For the .Ux/.Ox family of macros, do text production at the validation
stage rather than in each and every individual formatter, using the
new NODE_NOSRC flag.  More rigorous and also ten lines less code.

Revision 1.230 / (download) - annotate - [select for diffs], Tue Jan 10 13:46:53 2017 UTC (7 years, 4 months ago) by schwarze
Branch: MAIN
Changes since 1.229: +4 -4 lines
Diff to previous 1.229 (colored)

unify names of AST node flags; no change of cpp output

Revision 1.229 / (download) - annotate - [select for diffs], Tue Jan 10 12:54:28 2017 UTC (7 years, 4 months ago) by schwarze
Branch: MAIN
Changes since 1.228: +16 -15 lines
Diff to previous 1.228 (colored)

Introduce flags NODE_NOSRC and NODE_NOPRT for AST nodes.
Use them to mark generated nodes and nodes that shall not produce output.
Let -Ttree output mode display these new flags.
Use NODE_NOSRC for .Ar, .Mt, and .Pa default arguments.
Use NODE_NOPRT for .Dd, .Dt, and .Os.

These will help to make handling of text production macros more rigorous.

Revision 1.228 / (download) - annotate - [select for diffs], Sun Jan 8 02:01:14 2017 UTC (7 years, 4 months ago) by schwarze
Branch: MAIN
Changes since 1.227: +3 -2 lines
Diff to previous 1.227 (colored)

Tolerate bare tabs in SYNOPSIS .Cd for now.
It's used in half a dozen pages.
Even though i have been thinking about it for years,
i still can't suggest anything better.
The false positives are annoying.

Revision 1.227 / (download) - annotate - [select for diffs], Sun Jan 8 00:10:22 2017 UTC (7 years, 4 months ago) by schwarze
Branch: MAIN
Changes since 1.226: +19 -11 lines
Diff to previous 1.226 (colored)

Stricter validation of the NAME section, in particular:
- require a comma between names
- reject all other text nodes
- reject all empty Nm below NAME, not only in the leading position
- reject Nm after Nd

Revision 1.226 / (download) - annotate - [select for diffs], Wed Dec 28 17:21:17 2016 UTC (7 years, 4 months ago) by schwarze
Branch: MAIN
Changes since 1.225: +19 -3 lines
Diff to previous 1.225 (colored)

Make the second, section number argument of .Xr mandatory.
In fact, we have been requiring it for many years.
The only reason to not warn when it was missing
was excessive traditionalism - it was optional in 4.4BSD.

Revision 1.225 / (download) - annotate - [select for diffs], Sun Oct 9 18:16:46 2016 UTC (7 years, 7 months ago) by schwarze
Branch: MAIN
Changes since 1.224: +1 -82 lines
Diff to previous 1.224 (colored)

Delete complicated code dealing with .Bl -tag without -width,
and just let it default to -width 6n, which agrees with the
traditional -width Ds that is still in widespread use.

I just pushed a patch upstream to GNU roff that does the same for
groff_mdoc(7).  Before, groff contained code that was even more
complicated than mandoc, but both resulted in quite different
user-visible output.  Now, both agree, and output is nicer for both.

Useless complication noticed by Carsten Kunze (Heirloom roff).

Revision 1.224 / (download) - annotate - [select for diffs], Sat Aug 20 14:43:39 2016 UTC (7 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.223: +34 -6 lines
Diff to previous 1.223 (colored)

If a column list starts with implicit rows (that is, rows without .It)
and roff-level nodes (e.g. tbl or eqn) follow, don't run into an
assertion.  Instead, wrap the roff-level nodes in their own row.
Issue found by tb@ with afl(1).

Revision 1.223 / (download) - annotate - [select for diffs], Thu Aug 11 11:39:19 2016 UTC (7 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.222: +3 -2 lines
Diff to previous 1.222 (colored)

oops, fix stupid typo in previous

Revision 1.222 / (download) - annotate - [select for diffs], Thu Aug 11 10:46:27 2016 UTC (7 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.221: +5 -4 lines
Diff to previous 1.221 (colored)

If a .Bd display is on the one hand doomed to be deleted because
it has no type, but is on the other hand breaking another block,
delete its end marker as well, or the end marker may remain behind
as an orphan, triggering an assertion in the terminal formatter.
Problem found by tb@ with afl(1).

Revision 1.221 / (download) - annotate - [select for diffs], Wed Aug 10 20:16:43 2016 UTC (7 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.220: +8 -5 lines
Diff to previous 1.220 (colored)

Don't deref NULL if the only child of the first .Sh is an empty
in-line macro, and don't printf("%s", NULL) if the first child
of the first .Sh is a macro; again found by tb@ with afl(1).
(No, you should never use macros in any .Sh at all, please.)

Revision 1.220 / (download) - annotate - [select for diffs], Wed Aug 10 12:29:02 2016 UTC (7 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.219: +4 -3 lines
Diff to previous 1.219 (colored)

Don't printf("%s", NULL) if .It has a macro as an argument
in a list of a type where items don't takes arguments.
Issue found by tb@ with afl(1).

Revision 1.219 / (download) - annotate - [select for diffs], Wed Aug 10 12:04:57 2016 UTC (7 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.218: +2 -1 lines
Diff to previous 1.218 (colored)

When validating a .Bl list that defaults to -item for want of a type,
don't let a subsequent -width access mdoc_argnames[] out of bounds.
Found by tb@ with afl(1).

Revision 1.218 / (download) - annotate - [select for diffs], Tue Aug 9 15:08:15 2016 UTC (7 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.217: +5 -4 lines
Diff to previous 1.217 (colored)

fix printf("%s", NULL);
found while investigating an unrelated bug report from jsg@

Revision 1.217 / (download) - annotate - [select for diffs], Fri Jan 8 17:48:04 2016 UTC (8 years, 4 months ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_6_0_BASE, OPENBSD_6_0, OPENBSD_5_9_BASE, OPENBSD_5_9
Changes since 1.216: +12 -14 lines
Diff to previous 1.216 (colored)

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.

Revision 1.216 / (download) - annotate - [select for diffs], Fri Oct 30 19:03:36 2015 UTC (8 years, 6 months ago) by schwarze
Branch: MAIN
Changes since 1.215: +11 -1 lines
Diff to previous 1.215 (colored)

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@.

Revision 1.215 / (download) - annotate - [select for diffs], Wed Oct 21 23:49:05 2015 UTC (8 years, 6 months ago) by schwarze
Branch: MAIN
Changes since 1.214: +212 -242 lines
Diff to previous 1.214 (colored)

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.

Revision 1.214 / (download) - annotate - [select for diffs], Tue Oct 20 02:00:49 2015 UTC (8 years, 7 months ago) by schwarze
Branch: MAIN
Changes since 1.213: +65 -130 lines
Diff to previous 1.213 (colored)

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.

Revision 1.213 / (download) - annotate - [select for diffs], Mon Oct 19 20:03:57 2015 UTC (8 years, 7 months ago) by schwarze
Branch: MAIN
Changes since 1.212: +59 -56 lines
Diff to previous 1.212 (colored)

style cleanup, no functional change

Revision 1.212 / (download) - annotate - [select for diffs], Mon Oct 12 21:25:36 2015 UTC (8 years, 7 months ago) by schwarze
Branch: MAIN
Changes since 1.211: +1 -2 lines
Diff to previous 1.211 (colored)

Delete an assignment that is unconditionally overwritten two lines later;
found by Svyatoslav Mishyn <juef at openmailbox dot org>
with the clang static analyzer.

Revision 1.211 / (download) - annotate - [select for diffs], Mon Oct 12 00:07:27 2015 UTC (8 years, 7 months ago) by schwarze
Branch: MAIN
Changes since 1.210: +2 -23 lines
Diff to previous 1.210 (colored)

To make the code more readable, delete 283 /* FALLTHROUGH */ comments
that were right between two adjacent case statement.  Keep only
those 24 where the first case actually executes some code before
falling through to the next case.

Revision 1.210 / (download) - annotate - [select for diffs], Tue Oct 6 18:30:44 2015 UTC (8 years, 7 months ago) by schwarze
Branch: MAIN
Changes since 1.209: +47 -47 lines
Diff to previous 1.209 (colored)

modernize style: "return" is not a function; ok cmp(1)

Revision 1.209 / (download) - annotate - [select for diffs], Sat Sep 26 00:53:15 2015 UTC (8 years, 7 months ago) by schwarze
Branch: MAIN
Changes since 1.208: +1 -4 lines
Diff to previous 1.208 (colored)

/* NOTREACHED */ after abort() is silly, delete it

Revision 1.208 / (download) - annotate - [select for diffs], Mon Sep 14 15:35:47 2015 UTC (8 years, 8 months ago) by schwarze
Branch: MAIN
Changes since 1.207: +2 -25 lines
Diff to previous 1.207 (colored)

Remove the warning about children of .Vt blocks because actually,
.Vt type global_variable No = Dv defined_constant ;
is the best way to specify in the SYNOPSIS how a global variable
is initialized in the rare case where that matters.
Issue noticed by jmc@.

Revision 1.207 / (download) - annotate - [select for diffs], Thu Apr 23 16:17:04 2015 UTC (9 years ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_5_8_BASE, OPENBSD_5_8
Changes since 1.206: +5 -5 lines
Diff to previous 1.206 (colored)

Unify mdoc_deroff() and man_deroff() into a common function deroff().
No functional change except that for mdoc(7), it now skips leading
escape sequences just like it already did for man(7).
Escape sequences rarely occur in mdoc(7) code and if they do,
skipping them is an improvement in this context.
Minus 30 lines of code.

Revision 1.206 / (download) - annotate - [select for diffs], Mon Apr 20 09:48:19 2015 UTC (9 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.205: +3 -2 lines
Diff to previous 1.205 (colored)

Avoid out-of-bounds read access before the beginning of the
mdoc_macros[] array.  This sometimes prevented proper warnings
about text nodes preceding the first section header.

Revision 1.205 / (download) - annotate - [select for diffs], Sun Apr 19 14:25:05 2015 UTC (9 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.204: +6 -6 lines
Diff to previous 1.204 (colored)

Unify some node handling functions that use TOKEN_NONE.
* mdoc_word_alloc(), man_word_alloc() -> roff_word_alloc()
* mdoc_word_append(), man_word_append() -> roff_word_append()
* mdoc_addspan(), man_addspan() -> roff_addtbl()
* mdoc_addeqn(), man_addeqn() -> roff_addeqn()
Minus 50 lines of code, no functional change.

Revision 1.204 / (download) - annotate - [select for diffs], Sun Apr 19 13:59:37 2015 UTC (9 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.203: +3 -3 lines
Diff to previous 1.203 (colored)

Decouple the token code for "no request or macro" from the individual
high-level parsers to allow further unification of functions that
only need to recognize this code, but that don't care about different
high-level macrosets beyond that.

Revision 1.203 / (download) - annotate - [select for diffs], Sun Apr 19 13:50:10 2015 UTC (9 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.202: +16 -15 lines
Diff to previous 1.202 (colored)

Unify node handling functions:
* node_alloc() for mdoc and man_node_alloc() -> roff_node_alloc()
* node_append() for mdoc and man_node_append() -> roff_node_append()
* mdoc_head_alloc() and man_head_alloc() -> roff_head_alloc()
* mdoc_body_alloc() and man_body_alloc() -> roff_body_alloc()
* mdoc_node_unlink() and man_node_unlink() -> roff_node_unlink()
* mdoc_node_free() and man_node_free() -> roff_node_free()
* mdoc_node_delete() and man_node_delete() -> roff_node_delete()
Minus 130 lines of code, no functional change.

Revision 1.202 / (download) - annotate - [select for diffs], Sat Apr 18 16:04:40 2015 UTC (9 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.201: +15 -15 lines
Diff to previous 1.201 (colored)

Replace the structs mdoc and man by a unified struct roff_man.
Almost completely mechanical, no functional change.
Written on the train from Exeter to London returning from p2k15.

Revision 1.201 / (download) - annotate - [select for diffs], Thu Apr 2 22:06:17 2015 UTC (9 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.200: +56 -56 lines
Diff to previous 1.200 (colored)

Second step towards parser unification:
Replace struct mdoc_node and struct man_node by a unified struct roff_node.
To be able to use the tok member for both mdoc(7) and man(7) without
defining all the macros in roff.h, sacrifice a tiny bit of type safety
and make tok an int rather than an enum.
Almost mechanical, no functional change.
Written on the Eurostar from Bruxelles to London on the way to p2k15.

Revision 1.200 / (download) - annotate - [select for diffs], Thu Apr 2 21:03:18 2015 UTC (9 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.199: +50 -49 lines
Diff to previous 1.199 (colored)

First step towards parser unification:
Replace enum mdoc_type and enum man_type by a unified enum roff_type.
Almost mechanical, no functional change.
Written on the ICE train from Frankfurt to Bruxelles on the way to p2k15.

Revision 1.199 / (download) - annotate - [select for diffs], Mon Feb 23 13:54:39 2015 UTC (9 years, 2 months ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_5_7_BASE, OPENBSD_5_7
Changes since 1.198: +5 -1 lines
Diff to previous 1.198 (colored)

oops, in NAME, don't nag about the comma after .Nm

Revision 1.198 / (download) - annotate - [select for diffs], Mon Feb 23 13:30:02 2015 UTC (9 years, 2 months ago) by schwarze
Branch: MAIN
Changes since 1.197: +25 -25 lines
Diff to previous 1.197 (colored)

improve NAME section diagnostics;
confusing messages reported by Jan Stary <hans at stare dot cz>

Revision 1.197 / (download) - annotate - [select for diffs], Tue Feb 17 20:33:44 2015 UTC (9 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.196: +2 -2 lines
Diff to previous 1.196 (colored)

Render \(lq and \(rq as '"' in -Tascii mode but leave the rendering
of .Do/.Dc, .Dq, .Lb, and .St untouched.
Reduces groff-mandoc differences in base by about 7%.
Reminded of the issue by naddy@.

Revision 1.196 / (download) - annotate - [select for diffs], Mon Feb 16 19:02:32 2015 UTC (9 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.195: +41 -43 lines
Diff to previous 1.195 (colored)

clean up post_dt() validation function;
improved diagnostics, minus six lines of code

Revision 1.195 / (download) - annotate - [select for diffs], Sat Feb 14 13:22:12 2015 UTC (9 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.194: +3 -2 lines
Diff to previous 1.194 (colored)

shut up about tabs in SYNOPSIS .Fd lines, there is no good way to avoid them

Revision 1.194 / (download) - annotate - [select for diffs], Thu Feb 12 12:20:47 2015 UTC (9 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.193: +6 -40 lines
Diff to previous 1.193 (colored)

Delete the mdoc_node.pending pointer and the function calculating
it, make_pending(), which was the most difficult function of the
whole mdoc(7) parser.  After almost five years of maintaining this
hellhole, i just noticed the pointer isn't needed after all.

Blocks are always rewound in the reverse order they were opened;
that even holds for broken blocks.  Consequently, it is sufficient
to just mark broken blogs with the flag MDOC_BROKEN and breaking
blocks with the flag MDOC_ENDED.  When rewinding, instead of iterating
the pending pointers, just iterate from each broken block to its
parents, rewinding all that are MDOC_ENDED and stopping after
processing the first ancestor that it not MDOC_BROKEN.  For ENDBODY
markers, use the mdoc_node.body pointer in place of the former
mdoc_node.pending.

This also fixes an assertion failure found by jsg@ with afl,
test case #467 (Bo Bl It Bd Bc It), where (surprise surprise)
the pending pointer got corrupted.

Improved functionality, minus one function, minus one struct field,
minus 50 lines of code.

Revision 1.193 / (download) - annotate - [select for diffs], Tue Feb 10 08:05:07 2015 UTC (9 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.192: +2 -2 lines
Diff to previous 1.192 (colored)

trim trailing white space, no code change;
from Svyatoslav Mishyn <juef at openmailboxd dot org>, Crux Linux

Revision 1.192 / (download) - annotate - [select for diffs], Fri Feb 6 16:05:51 2015 UTC (9 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.191: +3 -3 lines
Diff to previous 1.191 (colored)

replace the last legacy generic message type, "argument count wrong",
by more specific messages, improving diagnostics for .cc .tr .Bl -column

Revision 1.191 / (download) - annotate - [select for diffs], Fri Feb 6 07:12:34 2015 UTC (9 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.190: +19 -81 lines
Diff to previous 1.190 (colored)

Delete the legacy generic warning type MANDOCERR_ARGCWARN,
replacing the last instances by more specific warnings.
Improved functionality, minus 50 lines of code.

Revision 1.190 / (download) - annotate - [select for diffs], Fri Feb 6 03:31:11 2015 UTC (9 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.189: +22 -13 lines
Diff to previous 1.189 (colored)

better handle .Fo and .Fd without argument
better handle .Fo with more than one argument

Revision 1.189 / (download) - annotate - [select for diffs], Fri Feb 6 02:04:35 2015 UTC (9 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.188: +45 -39 lines
Diff to previous 1.188 (colored)

better handle empty .Bd .Bl .D1 .Dl blocks

Revision 1.188 / (download) - annotate - [select for diffs], Fri Feb 6 01:07:07 2015 UTC (9 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.187: +3 -11 lines
Diff to previous 1.187 (colored)

better handle .In .Sh .Ss .St .Xr without arguments

Revision 1.187 / (download) - annotate - [select for diffs], Thu Feb 5 01:46:38 2015 UTC (9 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.186: +7 -5 lines
Diff to previous 1.186 (colored)

fix handling of empty .An macros

Revision 1.186 / (download) - annotate - [select for diffs], Wed Feb 4 22:29:28 2015 UTC (9 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.185: +37 -36 lines
Diff to previous 1.185 (colored)

Discard excess head arguments for .Bd .Bl .Bk and delete hwarn_eq0().
Discard empty .Bk blocks.
Improve related diagnostics.

Revision 1.185 / (download) - annotate - [select for diffs], Wed Feb 4 19:11:17 2015 UTC (9 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.184: +15 -11 lines
Diff to previous 1.184 (colored)

improve diagnostics regarding arguments of .An .Pp .Lp .br .sp
in particular, get rid of check_count(..., CHECK_EQ, 0)

Revision 1.184 / (download) - annotate - [select for diffs], Wed Feb 4 18:03:28 2015 UTC (9 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.183: +34 -36 lines
Diff to previous 1.183 (colored)

discard .Rs head arguments and improve .Rs diagnostics

Revision 1.183 / (download) - annotate - [select for diffs], Wed Feb 4 16:38:31 2015 UTC (9 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.182: +27 -25 lines
Diff to previous 1.182 (colored)

more specific .Nd diagnostics, allowing to get rid of enum check_lvl
and the respective argument of check_count()

Revision 1.182 / (download) - annotate - [select for diffs], Tue Feb 3 00:48:27 2015 UTC (9 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.181: +12 -4 lines
Diff to previous 1.181 (colored)

Bring .Pp/.Lp handling inside .Nm blocks closer to groff;
as a bonus, get rid of another call to rew_sub().

Revision 1.181 / (download) - annotate - [select for diffs], Thu Dec 18 20:15:31 2014 UTC (9 years, 5 months ago) by schwarze
Branch: MAIN
Changes since 1.180: +5 -2 lines
Diff to previous 1.180 (colored)

Only keep leading .Sm inside a list when it immediately precedes
the first .It.  Otherwise, move it out together with whatever
follows.  Fixing an assertion failure found by jsg@ with afl.

Revision 1.180 / (download) - annotate - [select for diffs], Thu Dec 18 19:22:47 2014 UTC (9 years, 5 months ago) by schwarze
Branch: MAIN
Changes since 1.179: +7 -7 lines
Diff to previous 1.179 (colored)

When the head of a list item is extended with a partial explicit
macro (for example .Xo) and never closed again, the item ends up
without a body block.  This can even happen for list types that
usually don't have heads in the first place.  So even in this
case, check for the existence of the body before accessing it.
NULL pointer access found by jsg@ with afl.

Revision 1.179 / (download) - annotate - [select for diffs], Sun Nov 30 05:28:00 2014 UTC (9 years, 5 months ago) by schwarze
Branch: MAIN
Changes since 1.178: +2 -2 lines
Diff to previous 1.178 (colored)

Multiple fixes with respect to .Pf:
* The first argument of .Pf is not parsed.
* Normal delimiter handling does not apply to the first argument of .Pf.
* Warn if nothing follows a prefix (inspired by groff_mdoc(7)).
* In that case, do not suppress spacing.

Revision 1.178 / (download) - annotate - [select for diffs], Fri Nov 28 18:35:37 2014 UTC (9 years, 5 months ago) by schwarze
Branch: MAIN
Changes since 1.177: +3 -13 lines
Diff to previous 1.177 (colored)

Retire support for CSRG supplementary document titles.  These are
long obsolete and were never written in mdoc(7) in the first place.
Removes 100 lines from source files.

Revision 1.177 / (download) - annotate - [select for diffs], Fri Nov 28 18:07:38 2014 UTC (9 years, 5 months ago) by schwarze
Branch: MAIN
Changes since 1.176: +7 -14 lines
Diff to previous 1.176 (colored)

Drop useless architecture table.  Validating architecture names
is a job for makewhatis(8)/mandoc.db(5), not for the parser.
Removes 150 lines from source files and 4k (1%) from the binary.
Bloat found by deraadt@.

Revision 1.176 / (download) - annotate - [select for diffs], Fri Nov 28 17:23:34 2014 UTC (9 years, 5 months ago) by schwarze
Branch: MAIN
Changes since 1.175: +2 -12 lines
Diff to previous 1.175 (colored)

Remove bulky, irrelevant library description string tables
not used by a single manual in OpenBSD and just print library names;
will remain in the portable version for use by FreeBSD and NetBSD.
Removes 150 lines from source tree and 16 Kilobytes (4%) from binary.
Bloat found by deraadt@.

Revision 1.175 / (download) - annotate - [select for diffs], Fri Nov 28 01:05:40 2014 UTC (9 years, 5 months ago) by schwarze
Branch: MAIN
Changes since 1.174: +222 -323 lines
Diff to previous 1.174 (colored)

Simplify code by making mdoc validation handlers void.
No functional change, minus 90 lines of code.

Revision 1.174 / (download) - annotate - [select for diffs], Thu Nov 27 23:35:03 2014 UTC (9 years, 5 months ago) by schwarze
Branch: MAIN
Changes since 1.173: +2 -2 lines
Diff to previous 1.173 (colored)

Downgrade .Bd -file from FATAL to ERROR.
Since this was the last remaining FATAL error in this area,
this change will allow major simplifications in the mdoc(7) parser.

Revision 1.173 / (download) - annotate - [select for diffs], Thu Nov 27 16:20:27 2014 UTC (9 years, 5 months ago) by schwarze
Branch: MAIN
Changes since 1.172: +13 -19 lines
Diff to previous 1.172 (colored)

Fix the obsolete .Db (toggle debug mode) macro to ignore its arguments
and not trigger an assertion when there is more than one argument;
the latter found by jsg@ with afl.

Revision 1.172 / (download) - annotate - [select for diffs], Wed Nov 26 19:23:47 2014 UTC (9 years, 5 months ago) by schwarze
Branch: MAIN
Changes since 1.171: +1 -3 lines
Diff to previous 1.171 (colored)

remove an unreachable warning about .Sm arguments

Revision 1.171 / (download) - annotate - [select for diffs], Mon Nov 17 06:44:35 2014 UTC (9 years, 6 months ago) by schwarze
Branch: MAIN
Changes since 1.170: +16 -6 lines
Diff to previous 1.170 (colored)

Multiple fixes with respect to in-line macros:
* .No selects the default font; relevant e.g. in .Bf blocks
* no need to force empty .Li elements
* closing delimiters as leading macro arguments do not suppress space
* opening delimiters at the end of a macro line do not suppress space
* correctly handle delimiter spacing in -Tman
As a side effect, these fixes let mandoc warn about empty .No macros
as requested by bentley@.

Revision 1.170 / (download) - annotate - [select for diffs], Thu Oct 30 20:05:33 2014 UTC (9 years, 6 months ago) by schwarze
Branch: MAIN
Changes since 1.169: +19 -43 lines
Diff to previous 1.169 (colored)

Major bugsquashing with respect to -offset and -width:
1. Support specifying the .Bd and .Bl -offset as a macro default width;
while here, simplify the code handling the same for .Bl -width.
2. Correct handling of .Bl -offset arguments:  unlike .Bd -offset, the
arguments "left", "indent", and "indent-two" have no special meaning.
3. Fix the scaling of string length -offset and -width arguments in -Thtml.
Triggered by an incomplete documentation patch from bentley@.

Revision 1.169 / (download) - annotate - [select for diffs], Mon Oct 13 14:01:03 2014 UTC (9 years, 7 months ago) by schwarze
Branch: MAIN
Changes since 1.168: +6 -4 lines
Diff to previous 1.168 (colored)

Do not warn about declarations of functions returning function pointers,
getting rid of a false positive noticed by bentley@.

Revision 1.168 / (download) - annotate - [select for diffs], Sat Oct 11 21:33:58 2014 UTC (9 years, 7 months ago) by schwarze
Branch: MAIN
Changes since 1.167: +2 -2 lines
Diff to previous 1.167 (colored)

oops, don't crash when .Fo has no argument

Revision 1.167 / (download) - annotate - [select for diffs], Sat Oct 11 21:14:11 2014 UTC (9 years, 7 months ago) by schwarze
Branch: MAIN
Changes since 1.166: +29 -2 lines
Diff to previous 1.166 (colored)

warn about parentheses in function names after .Fn and .Fo;
particularly useful when converting from other languages to mdoc(7);
feature suggested by bentley@

Revision 1.166 / (download) - annotate - [select for diffs], Fri Sep 12 00:53:21 2014 UTC (9 years, 8 months ago) by schwarze
Branch: MAIN
Changes since 1.165: +26 -3 lines
Diff to previous 1.165 (colored)

warn about commas in function arguments; inspired by mdoclint(1)

Revision 1.165 / (download) - annotate - [select for diffs], Thu Sep 11 23:52:47 2014 UTC (9 years, 8 months ago) by schwarze
Branch: MAIN
Changes since 1.164: +67 -1 lines
Diff to previous 1.164 (colored)

warn about botched .Xr ordering and punctuation below SEE ALSO;
inspired by mdoclint(1)

Revision 1.164 / (download) - annotate - [select for diffs], Sun Sep 7 23:24:33 2014 UTC (9 years, 8 months ago) by schwarze
Branch: MAIN
Changes since 1.163: +40 -9 lines
Diff to previous 1.163 (colored)

warn about AUTHORS sections without .An macros, inspired by mdoclint(1)

Revision 1.163 / (download) - annotate - [select for diffs], Sun Sep 7 00:04:47 2014 UTC (9 years, 8 months ago) by schwarze
Branch: MAIN
Changes since 1.162: +9 -10 lines
Diff to previous 1.162 (colored)

Allow .ll in the prologue; Daniel Levai reports Slackware Linux uses this.

Revision 1.162 / (download) - annotate - [select for diffs], Tue Aug 19 17:28:57 2014 UTC (9 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.161: +4 -4 lines
Diff to previous 1.161 (colored)

Do not dereference a NULL pointer if a .Bl macro has
no -type, -width, -offset or -compact arguments whatsoever;
this got broken in mdoc_validate.c rev. 1.156.
While here, sort headers.

Revision 1.161 / (download) - annotate - [select for diffs], Fri Aug 8 16:17:09 2014 UTC (9 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.160: +74 -82 lines
Diff to previous 1.160 (colored)

Bring the handling of defective prologues even closer to groff,
in particular relaxing the distinction between prologue and body
and further improving messages.
* The last .Dd wins and the last .Os wins, even in the body.
* The last .Dt before the first body macro wins.
* Missing title in .Dt defaults to UNTITLED.  Warn about it.
* Missing section in .Dt does not default to 1.  But warn about it.
* Do not warn multiple times about the same mdoc(7) prologue macro.
* Warn about missing .Os.
* Incomplete .TH defaults to empty strings.  Warn about it.

Revision 1.160 / (download) - annotate - [select for diffs], Fri Aug 8 16:11:10 2014 UTC (9 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.159: +150 -128 lines
Diff to previous 1.159 (colored)

Simplify by allowing only one post-handler.
Saves 36 static arrays and 10 lines of code
at the expense of only five new trivial static functions.
No functional change.

Revision 1.159 / (download) - annotate - [select for diffs], Fri Aug 8 16:08:19 2014 UTC (9 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.158: +29 -47 lines
Diff to previous 1.158 (colored)

Simplify by allowing only one pre-handler.
Saves 12 static arrays and 19 lines of code.
No functional change.

Revision 1.158 / (download) - annotate - [select for diffs], Fri Aug 8 15:57:05 2014 UTC (9 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.157: +5 -3 lines
Diff to previous 1.157 (colored)

demacrify: get rid of man_nmsg(), man_pmsg(), mdoc_nmsg(), mdoc_pmsg()

Revision 1.157 / (download) - annotate - [select for diffs], Fri Aug 8 15:54:10 2014 UTC (9 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.156: +45 -33 lines
Diff to previous 1.156 (colored)

mention requests and macros in more messages

Revision 1.156 / (download) - annotate - [select for diffs], Fri Aug 8 15:45:58 2014 UTC (9 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.155: +22 -10 lines
Diff to previous 1.155 (colored)

Split MANDOCERR_IGNARGV into one message for .An and one for .Bl
and report the macro name and argument.

Revision 1.155 / (download) - annotate - [select for diffs], Fri Aug 8 15:42:39 2014 UTC (9 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.154: +13 -21 lines
Diff to previous 1.154 (colored)

In .Bl -column, if some of the column width declarations are given
right after the -column argument and some at the very end of the
argument list, after some other arguments like -compact, concatenate
the column lists.
This gets rid of one of the last useless FATAL errors
and actually shortens the code by a few lines.

This fixes an issue introduced more than five years ago, at first
causing an assert() since bsd.lv mdoc_action.c rev. 1.14 (June 17, 2009),
then later a FATAL error since mdoc_validate rev. 1.130 (Nov. 30, 2010),
and marked as "TODO" ever since.

Revision 1.154 / (download) - annotate - [select for diffs], Fri Aug 8 15:38:46 2014 UTC (9 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.153: +6 -12 lines
Diff to previous 1.153 (colored)

Remove the useless FATAL error "argument count wrong, violates syntax".
The last remaining instance was .It in .Bl -column with more than one
excessive .Ta.  However, simply downgrading from FATAL to ERROR, it just
works fine, almost the same way as in groff, without any other changes.

Revision 1.153 / (download) - annotate - [select for diffs], Fri Aug 8 15:26:28 2014 UTC (9 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.152: +4 -54 lines
Diff to previous 1.152 (colored)

Get rid of the useless FATAL error "child violates parent syntax".
When finding items outside lists, simply skip them and throw an ERROR.
Handle subsections before the first section instead of bailing out.

Revision 1.152 / (download) - annotate - [select for diffs], Fri Aug 8 15:21:17 2014 UTC (9 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.151: +16 -8 lines
Diff to previous 1.151 (colored)

Remove two useless FATAL errors.
When a file contains neither text nor macros, treat it as an empty document.
When the mdoc(7) document prologue is incomplete, use some default values.

Revision 1.151 / (download) - annotate - [select for diffs], Fri Aug 8 15:15:27 2014 UTC (9 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.150: +3 -2 lines
Diff to previous 1.150 (colored)

better name and wording for the last two non-generic errors

Revision 1.150 / (download) - annotate - [select for diffs], Fri Aug 8 15:10:15 2014 UTC (9 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.149: +17 -26 lines
Diff to previous 1.149 (colored)

Various improvements related to .Ex and .Rv:
* let .Nm fall back to the empty string, not to UNKNOWN
* never let .Rv copy an argument from .Nm
* avoid spurious \fR after empty .Nm in -Tman
* correct handling of .Ex and .Rv in -Tman
* correct the wording of the output for .Rv without arguments
* use non-breaking spaces in .Ex and .Rv output where required
* split MANDOCERR_NONAME into a warning for .Ex and an error for .Nm

Revision 1.149 / (download) - annotate - [select for diffs], Fri Aug 8 15:03:25 2014 UTC (9 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.148: +2 -2 lines
Diff to previous 1.148 (colored)

Partial implementation of .Bd -centered.

In groff, .Bd -centered operates in fill mode, which is relatively
hard to implement, while this implementation operates in non-fill
mode so far.  As long as you pay attention that your lines do not
overflow, it works.  To make sure that rendering is the same for
mandoc and groff, it is recommended to insert .br between lines
for now.  This implementation will need improvement later.

Revision 1.148 / (download) - annotate - [select for diffs], Mon Jul 7 16:12:06 2014 UTC (9 years, 10 months ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_5_6_BASE, OPENBSD_5_6
Changes since 1.147: +12 -35 lines
Diff to previous 1.147 (colored)

no need to delete any content from .Rs blocks,
and downgrade the related message from ERROR to WARNING

Revision 1.147 / (download) - annotate - [select for diffs], Sun Jul 6 19:08:56 2014 UTC (9 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.146: +3 -2 lines
Diff to previous 1.146 (colored)

Clean up messages related to plain text and to escape sequences.
* Mention invalid escape sequences and string names, and fallbacks.
* Hierarchical naming.

Revision 1.146 / (download) - annotate - [select for diffs], Sat Jul 5 12:33:54 2014 UTC (9 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.145: +62 -57 lines
Diff to previous 1.145 (colored)

Cleanup with respect to bad macro arguments.
* Fix .Sm with invalid arg: move arg out and toggle mode.
* Promote "unknown standard" from WARNING to ERROR, it loses information.
* Delete MANDOCERR_BADWIDTH, it would only indicate a mandoc(1) bug.
* Do not report MANDOCERR_BL_LATETYPE when there is no type at all.
* Mention macro names, arguments and fallbacks.

Revision 1.145 / (download) - annotate - [select for diffs], Sat Jul 5 01:11:33 2014 UTC (9 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.144: +52 -56 lines
Diff to previous 1.144 (colored)

Cleanup regarding -offset and -width:
* Bugfix: Last one wins, not first one.
* Fix .Bl -width without argument: it means 0n, so do not ignore it.
* Report macro names, argument names and fallbacks in related messages.
* Simplify: Garbage collect auxiliary variables in pre_bd() and pre_bl().

Revision 1.144 / (download) - annotate - [select for diffs], Fri Jul 4 16:11:41 2014 UTC (9 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.143: +27 -24 lines
Diff to previous 1.143 (colored)

Clean up messages regarding excess arguments:
* Downgrade ".Bf -emphasis Em" from FATAL to WARNING.
* Mention the macros, the arguments, and the fallbacks.
* Hierarchical naming.
Also fix the handling of excess .It head arguments in -Tman.

Revision 1.143 / (download) - annotate - [select for diffs], Fri Jul 4 01:50:03 2014 UTC (9 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.142: +13 -17 lines
Diff to previous 1.142 (colored)

Clean up messages related to missing arguments.
* Do not warn about empty -column cells, they seem valid to me.
* Downgrade empty item and missing -std from ERROR to WARNING.
* Hierarchical naming.
* Descriptive, not imperative style.
* Mention macro names, argument names, and fallbacks.
* Garbage collect some unreachable code in post_it().

Revision 1.142 / (download) - annotate - [select for diffs], Thu Jul 3 23:23:45 2014 UTC (9 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.141: +23 -25 lines
Diff to previous 1.141 (colored)

Fix formatting of empty .Bl -inset item heads.
Downgrade empty item heads from ERROR to WARNING.
Show the list type in the error message.
Choose better variable names for nodes in post_it().

Revision 1.141 / (download) - annotate - [select for diffs], Wed Jul 2 20:18:42 2014 UTC (9 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.140: +4 -2 lines
Diff to previous 1.140 (colored)

Improve and test the messages about empty macros,
in particular reporting the macro names involved.

Revision 1.140 / (download) - annotate - [select for diffs], Wed Jul 2 19:54:39 2014 UTC (9 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.139: +5 -4 lines
Diff to previous 1.139 (colored)

When .Sm is called without an argument, groff toggles the spacing mode,
so let us do the same for compatibility.  Using this feature is of
course not recommended except in manual page obfuscation contests.

Revision 1.139 / (download) - annotate - [select for diffs], Wed Jul 2 13:10:15 2014 UTC (9 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.138: +8 -4 lines
Diff to previous 1.138 (colored)

Disentangle the MANDOCERR_CHILD message, which reported three
completely different things, into three distinct messages.
Also mention the macro names we are talking about.

Revision 1.138 / (download) - annotate - [select for diffs], Wed Jul 2 11:42:56 2014 UTC (9 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.137: +5 -3 lines
Diff to previous 1.137 (colored)

Clean up warnings related to macros and nesting.
* Hierarchical naming of enum mandocerr items.
* Improve the wording to make it comprehensible.
* Mention the offending macro.
* Garbage collect one chunk of ancient, long unreachable code.

Revision 1.137 / (download) - annotate - [select for diffs], Wed Jul 2 05:51:49 2014 UTC (9 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.136: +30 -14 lines
Diff to previous 1.136 (colored)

Improve "skipping paragraph macro" messages,
showing which macro was skipped and before or after what.

Revision 1.136 / (download) - annotate - [select for diffs], Wed Jul 2 03:47:07 2014 UTC (9 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.135: +38 -5 lines
Diff to previous 1.135 (colored)

Implement the obsolete macros .En .Es .Fr .Ot for backward compatibility,
since this is hardly more complicated than explicitly ignoring them
as we did in the past.  Of course, do not use them!

Revision 1.135 / (download) - annotate - [select for diffs], Tue Jul 1 22:36:35 2014 UTC (9 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.134: +48 -27 lines
Diff to previous 1.134 (colored)

Clean up the warnings related to document structure.
* Hierarchical naming of the related enum mandocerr items.
* Mention the offending macro, section title, or string.
While here, improve some wordings:
* Descriptive instead of imperative style.
* Uniform style for "missing" and "skipping".
* Where applicable, mention the fallback used.

Revision 1.134 / (download) - annotate - [select for diffs], Fri Jun 20 22:58:41 2014 UTC (9 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.133: +10 -14 lines
Diff to previous 1.133 (colored)

As suggested by jmc@, only include line and column numbers into messages
when they are meaningful, to avoid confusing stuff like this:
$ mandoc /dev/null
mandoc: /dev/null:0:1: FATAL: not a manual
Instead, just say:
mandoc: /dev/null: FATAL: not a manual

Another example this applies to is documents having a prologue,
but lacking a body.  Do not throw a FATAL error for these; instead,
issue a warning and show the empty document, in the man(7) case with
the same amount of blank lines as groff does.  Also downgrade mdoc(7)
documents having content before the first .Sh from FATAL to WARNING.

Revision 1.133 / (download) - annotate - [select for diffs], Fri Jun 20 17:23:09 2014 UTC (9 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.132: +10 -10 lines
Diff to previous 1.132 (colored)

Start systematic improvements of error reporting.
So far, this covers all WARNINGs related to the prologue.

1) hierarchical naming of MANDOCERR_* constants
2) mention the macro name in messages where that adds clarity
3) add one missing MANDOCERR_DATE_MISSING msg
4) fix the wording of one message related to the man(7) prologue

Started on the plane back from Ottawa.

Revision 1.132 / (download) - annotate - [select for diffs], Wed Apr 23 21:06:33 2014 UTC (10 years ago) by schwarze
Branch: MAIN
Changes since 1.131: +5 -5 lines
Diff to previous 1.131 (colored)

Audit malloc(3)/calloc(3)/realloc(3) usage.
* Change eight reallocs to reallocarray to be safe from overflows.
* Change one malloc to reallocarray to be safe from overflows.
* Change one calloc to reallocarray, no zeroing needed.
* Change the order of arguments of three callocs (aesthetical).

Revision 1.131 / (download) - annotate - [select for diffs], Wed Apr 23 16:07:06 2014 UTC (10 years ago) by schwarze
Branch: MAIN
Changes since 1.130: +12 -21 lines
Diff to previous 1.130 (colored)

Audit strlcpy(3)/strlcat(3) usage.

* Repair three instances of silent truncation, use asprintf(3).
* Change two instances of strlen(3)+malloc(3)+strlcpy(3)+strlcat(3)+...
to use asprintf(3) instead to make them less error prone.
* Cast the return value of four instances where the destination
buffer is known to be large enough to (void).
* Completely remove three useless instances of strlcpy(3)/strlcat(3).
* Mark two places in -Thtml with XXX that can cause information loss
and crashes but are not easy to fix, requiring design changes of
some internal interfaces.
* The file mandocdb.c remains to be audited.

Revision 1.130 / (download) - annotate - [select for diffs], Sun Apr 20 20:48:34 2014 UTC (10 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.129: +14 -23 lines
Diff to previous 1.129 (colored)

strlen+malloc+snprintf is error prone;
rewrite post_lb() to use asprintf(3) instead

Revision 1.129 / (download) - annotate - [select for diffs], Sun Apr 20 19:39:35 2014 UTC (10 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.128: +5 -7 lines
Diff to previous 1.128 (colored)

make sure static buffers for snprintf(3) are large enough
and cast snprintf return value to (void) where they are

Revision 1.128 / (download) - annotate - [select for diffs], Sun Apr 20 16:44:44 2014 UTC (10 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.127: +240 -254 lines
Diff to previous 1.127 (colored)

KNF: case (FOO):  ->  case FOO, remove /* LINTED */ and /* ARGSUSED */,
remove trailing whitespace and blanks before tabs, improve some indenting;
no functional change

Revision 1.127 / (download) - annotate - [select for diffs], Tue Apr 15 00:41:02 2014 UTC (10 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.126: +8 -12 lines
Diff to previous 1.126 (colored)

Using macros in .Sh header lines, or having .Sm off or .Bk -words open
while processing .Sh, is not at all recommended, but it's not strictly
a syntax violation either, and in any case, mandoc must not die in an
assertion.  I broke this in rev. 1.124.

Crash found while trying to read the (rather broken) original 4.3BSD-Reno
od(1) manual page.

Revision 1.126 / (download) - annotate - [select for diffs], Mon Mar 31 00:02:45 2014 UTC (10 years, 1 month ago) by dlg
Branch: MAIN
Changes since 1.125: +4 -1 lines
Diff to previous 1.125 (colored)

recognise the CONTEXT section. we consider it only applicable to
section 9 manpages for now.

requested by schwartz@ pre 5.5
tweaks by jmc@ schwartz@
ok schwartz@

Revision 1.125 / (download) - annotate - [select for diffs], Sun Mar 30 19:47:32 2014 UTC (10 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.124: +2 -1 lines
Diff to previous 1.124 (colored)

Implement the roff(7) .ll (line length) request.
Found by naddy@ in the textproc/enchant(1) port.
Of course, do not use this in new manuals.

Revision 1.124 / (download) - annotate - [select for diffs], Sun Mar 23 15:14:29 2014 UTC (10 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.123: +27 -78 lines
Diff to previous 1.123 (colored)

Retire the old concat() function.
For .Sh, i wasn't even needed at all.
For .Dd, .Nm, and .Os, use the new mdoc_deroff() instead.
This gets rid of the last limited-size static buffers in this file,
hence eliminates the last explicit MANDOCERR_MEM throwers here,
and it shortens the code by 50 lines.

Revision 1.123 / (download) - annotate - [select for diffs], Fri Mar 21 22:52:21 2014 UTC (10 years, 2 months ago) by schwarze
Branch: MAIN
Changes since 1.122: +4 -6 lines
Diff to previous 1.122 (colored)

avoid repetitive code for asprintf error handling

Revision 1.122 / (download) - annotate - [select for diffs], Fri Mar 21 22:17:01 2014 UTC (10 years, 2 months ago) by schwarze
Branch: MAIN
Changes since 1.121: +2 -1 lines
Diff to previous 1.121 (colored)

The files mandoc.c and mandoc.h contained both specialised low-level
functions used for multiple languages (mdoc, man, roff), for example
mandoc_escape(), mandoc_getarg(), mandoc_eos(), and generic auxiliary
functions.  Split the auxiliaries out into their own file and header.
While here, do some #include cleanup.

Revision 1.121 / (download) - annotate - [select for diffs], Sun Feb 16 14:26:51 2014 UTC (10 years, 3 months ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_5_5_BASE, OPENBSD_5_5
Changes since 1.120: +5 -3 lines
Diff to previous 1.120 (colored)

After Werner Lemberg accepted and committed some updates to the manual
page template contained in groff_mdoc(7), catch up with our own stuff.
In particular, allow ERRORS in section 4 and DIAGNOSTICS in section 9.
ok jmc@

Revision 1.120 / (download) - annotate - [select for diffs], Sat Jan 11 22:16:03 2014 UTC (10 years, 4 months ago) by schwarze
Branch: MAIN
Changes since 1.119: +2 -2 lines
Diff to previous 1.119 (colored)

Remove useless use of strnlen(3).
Yuckiness pointed out by deraadt@.

Revision 1.119 / (download) - annotate - [select for diffs], Tue Jan 7 09:10:58 2014 UTC (10 years, 4 months ago) by schwarze
Branch: MAIN
Changes since 1.118: +23 -30 lines
Diff to previous 1.118 (colored)

Cache the result of uname(3) such that we don't need to call it
over and over again for each manual; found with gprof(1).
Speeds up mandocdb(8) -Q by 3%, now at 39.5% of makewhatis(8).

Revision 1.118 / (download) - annotate - [select for diffs], Mon Jan 6 22:39:19 2014 UTC (10 years, 4 months ago) by schwarze
Branch: MAIN
Changes since 1.117: +6 -6 lines
Diff to previous 1.117 (colored)

Another 18% speedup for mandocdb(8) -Q, found by gprof(1).
In -Q mode, refrain form validating and normalizing the format
of the date given in .Dd or .TH, as it won't be used anyway.

For /usr/share/man, mandocdb -Q now takes 45% of the time of makewhatis(8).

Revision 1.117 / (download) - annotate - [select for diffs], Mon Jan 6 00:53:14 2014 UTC (10 years, 4 months ago) by schwarze
Branch: MAIN
Changes since 1.116: +2 -1 lines
Diff to previous 1.116 (colored)

Joerg Sonnenberger contributed copyrightable amounts of text to
some files.  To make it clear that he also put his contributions
under the ISC license, with his explicit permission, add his
Copyright notice to the relevant files.  No code change.

Revision 1.116 / (download) - annotate - [select for diffs], Sun Dec 15 21:18:00 2013 UTC (10 years, 5 months ago) by schwarze
Branch: MAIN
Changes since 1.115: +3 -3 lines
Diff to previous 1.115 (colored)

The "value" argument to the roff(7) .nr requests ends right before
the first non-digit character.  While here, implement and document
an optional sign, requesting increment or decrement, as documented
in the Ossanna/Kernighan/Ritter troff manual and supported by groff.

Reported by bentley@ on discuss at mdocml.

Revision 1.115 / (download) - annotate - [select for diffs], Mon Oct 21 23:32:33 2013 UTC (10 years, 6 months ago) by schwarze
Branch: MAIN
Changes since 1.114: +9 -3 lines
Diff to previous 1.114 (colored)

There are three kinds of input lines: text lines, macros taking
positional arguments (like Dt Fn Xr) and macros taking text as
arguments (like Nd Sh Em %T An).  In the past, even the latter put
each word of their arguments into its own MDOC_TEXT node; instead,
concatenate arguments unless delimiters, keeps or spacing mode
prevent that.  Regarding mandoc(1), this is internal refactoring,
no output change intended.

Once we will switch mandocdb(8) from DB to SQLite in the future,
this is going to be required to support search expressions crossing
word boundaries, and it will reduce both database sizes and build
times by a bit more than 5% each.

Revision 1.114 / (download) - annotate - [select for diffs], Sun Oct 6 22:45:13 2013 UTC (10 years, 7 months ago) by schwarze
Branch: MAIN
Changes since 1.113: +62 -20 lines
Diff to previous 1.113 (colored)

We don't do hyphenation, but we allow breaking the line at hyphens that are
already there in the middle of words.  So far, we only allowed this on text
lines.  Now it turns out some macros allow this for their arguments, too,
in particular .Nd and most of the .%? citation macros.

Issue found by Franco Fichtner <franco at lastsummer dot de> while doing
systematic groff-mandoc comparisons in the DragonFly base system, THANKS!

While here, garbage collect two empty prevalidator function pointer lists
and sort a couple of function declarations.

Revision 1.113 / (download) - annotate - [select for diffs], Sun Oct 6 13:27:47 2013 UTC (10 years, 7 months ago) by schwarze
Branch: MAIN
Changes since 1.112: +60 -21 lines
Diff to previous 1.112 (colored)

If there is random stuff inside a .Bl block body before the first .It,
do not throw a FATAL error and do not die, but just throw a WARNING
and move the stuff out of the .Bl block.

This bug felt completely 2008-ish; meanwhile, such bugs from the
Kristaps-doesnt-like-syntax-errors-so-lets-just-give-up--Era
are becoming rare, but this was one of the last survivors.

Thanks to bentley@ for reminding me to finally fix this.

Revision 1.112 / (download) - annotate - [select for diffs], Thu Oct 3 19:32:25 2013 UTC (10 years, 7 months ago) by schwarze
Branch: MAIN
Changes since 1.111: +7 -6 lines
Diff to previous 1.111 (colored)

Support setting arbitrary roff(7) number registers,
preserving read support for the ".nr nS" SYNOPSIS state register;
read support for arbitrary registers is still not available.

Inspired by NetBSD roff.c rev. 1.18 (Christos Zoulas, March 21, 2013),
but implemented differently.  I don't want to have yet another different
implementation of a hash table in mandoc - it would be the second one
in roff.c alone and the fifth one in mandoc grand total.
Instead, i designed and implemented roff_setreg() and roff_getreg()
to be similar to roff_setstrn() and roff_getstrn().

Once we feel the need to optimize, we can introduce one common
hash table implementation for everything in mandoc.

Revision 1.111 / (download) - annotate - [select for diffs], Mon Sep 16 00:25:06 2013 UTC (10 years, 8 months ago) by schwarze
Branch: MAIN
Changes since 1.110: +3 -2 lines
Diff to previous 1.110 (colored)

One of the WARNING messages has to use the word "section" twice in two
different meanings, that cannot be helped.  But we can make this less
confusing by stating that the second instance refers to stuff like (2),
(3), and (9), and by adding the sections header the first instance
refers to, for example ERRORS or RETURN VALUES.

Source for confusion noticed by Jan Stary <hans at stare dot cz>,
better wording suggested by jmc@, tweaked by me.

Revision 1.110 / (download) - annotate - [select for diffs], Mon Aug 5 14:32:56 2013 UTC (10 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.109: +3 -3 lines
Diff to previous 1.109 (colored)

Put .%C before .%D in .Rs output
because that's the usual order in formal citations.

My patch that was accepted into groff by Werner Lemberg
uses the same order, so keep groff and mandoc consistent.

Committing now because jmc@ already starts to rely on the .%C macro,
see for example /usr/src/usr.bin/bdes/bdes.1 rev. 1.11.

Revision 1.109 / (download) - annotate - [select for diffs], Sat Nov 17 00:25:20 2012 UTC (11 years, 6 months ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_5_4_BASE, OPENBSD_5_4, OPENBSD_5_3_BASE, OPENBSD_5_3
Changes since 1.108: +17 -17 lines
Diff to previous 1.108 (colored)

Cleanup naming of local variables to make the code easier on the eye:
Settle for "struct man *man", "struct mdoc *mdoc", "struct meta *meta"
and avoid the confusing "*m" which was sometimes this, sometimes that.
No functional change.

ok kristaps@ some time ago

Revision 1.108 / (download) - annotate - [select for diffs], Fri Nov 16 22:20:40 2012 UTC (11 years, 6 months ago) by schwarze
Branch: MAIN
Changes since 1.107: +2 -2 lines
Diff to previous 1.107 (colored)

Warn about unknown volume or arch in Dt macro arguments;
patch written by Nicolas Joly <njoly at pasteur dot fr>.

Revision 1.107 / (download) - annotate - [select for diffs], Wed Jul 18 11:09:30 2012 UTC (11 years, 10 months ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_5_2_BASE, OPENBSD_5_2
Changes since 1.106: +34 -5 lines
Diff to previous 1.106 (colored)

Fix handling of paragraph macros inside lists:
* When they are trailing the last item, move them outside the list.
* When they are trailing any other none-compact item, drop them.

Improves formatting of 40 pages, e.g. grep(1), ksh(1), netstat(1),
ath(4), bsd.port.mk(5), pf.conf(5), mount(8), crypto(9).

Revision 1.106 / (download) - annotate - [select for diffs], Mon Jul 16 09:51:03 2012 UTC (11 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.105: +37 -7 lines
Diff to previous 1.105 (colored)

Several -mdoc parser improvements related to vertical spacing:
* So far, .Pp and .Lp were removed before paragraph type blocks.
* Now also remove .br before paragraph type blocks.
* Treat .Lp as a paragraph like .Pp, so remove .Pp, .Lp, .br before it.
* Do not treat .sp as a paragraph, don't remove anything before it.
* After .Sh, .Ss, .Pp, and .Lp, remove .Pp, .Lp, .sp, .br, and blank lines.
* After .sp and .br, remove .br.

Revision 1.105 / (download) - annotate - [select for diffs], Thu Jul 12 15:09:50 2012 UTC (11 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.104: +18 -13 lines
Diff to previous 1.104 (colored)

The post_nm() validation function crashed when the first .Nm child node
was a non-text node.  Fix this by rewriting post_nm() to always set
the meta name to UNKNOWN when the name is missing or unusable.
While here, make MANDOCERR_NONAME an ERROR, as it usually renders
the page content unintelligible.

Bug reported by Maxim <Belooussov at gmail dot com>, thanks.

Revision 1.104 / (download) - annotate - [select for diffs], Wed Jul 11 16:55:29 2012 UTC (11 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.103: +3 -3 lines
Diff to previous 1.103 (colored)

fix position and formatting of %U

Revision 1.103 / (download) - annotate - [select for diffs], Tue Jul 10 14:35:57 2012 UTC (11 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.102: +17 -5 lines
Diff to previous 1.102 (colored)

* implement -Tman .Bl -item -inset -diag -ohang -dash -hyphen -enum .It
* fix -Tman .Bl -bullet .It
* adjust the -Tascii .Bl -bullet -dash -hyphen .It
default and minimum width to new groff standards,
it changed from 4n (in groff 1.15) to 2n (in groff 1.21)
* same for -Tascii -enum, it changed from 5n to 2n
* use -hang formatting for -Tascii -enum -width 2n
* for -Tascii -enum, the default is -width 3n

Revision 1.102 / (download) - annotate - [select for diffs], Thu May 24 23:33:23 2012 UTC (11 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.101: +13 -12 lines
Diff to previous 1.101 (colored)

Support -Ios='OpenBSD 5.1' to override uname(3) as the source of the
default value for the mdoc(7) .Os macro.
Needed for man.cgi on the OpenBSD website.

Problem with man.cgi first noticed by deraadt@;
beck@ and deraadt@ agree with the way to solve the issue.

Revision 1.101 / (download) - annotate - [select for diffs], Sun Apr 15 10:31:00 2012 UTC (12 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.100: +9 -4 lines
Diff to previous 1.100 (colored)

Two bugfixes regarding the -width and -offset macro arguments:
1) They consume the next argument even if it starts with a dash.
2) When -width is the last argument on the line such that the
actual width argument is missing, downgrade from a fatal to a
non-fatal error, just like for -offset.  The formatting still
doesn't agree with groff, but at least we don't die any longer.

Item 2 was observed and that part of the patch coded by kristaps@,
who found lots of instances of this particular formatting error
in Mac OSX manuals.

Revision 1.100 / (download) - annotate - [select for diffs], Sat Dec 3 22:47:27 2011 UTC (12 years, 5 months ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_5_1_BASE, OPENBSD_5_1
Changes since 1.99: +11 -1 lines
Diff to previous 1.99 (colored)

remove useless "#ifdef __linux__" that crept in,
and trivial sync to bsd.lv (two new comments)

Revision 1.99 / (download) - annotate - [select for diffs], Fri Dec 2 01:45:43 2011 UTC (12 years, 5 months ago) by schwarze
Branch: MAIN
Changes since 1.98: +2 -2 lines
Diff to previous 1.98 (colored)

In man(7), when no explicit volume name is given, use the default
volume name for the respective manual section, just like in mdoc(7).
This gives us nicer page headers for cvs(1), lynx(1), tic(1),
mkhybrid(8), and many curses(3) manuals.

ok kristaps@

To not break compatibility, i wrote a corresponding patch for GNU troff
which Werner Lemberg accepted upstream at rev. 1.65 of:
http://cvs.savannah.gnu.org/viewvc/groff/tmac/an-old.tmac?root=groff

Revision 1.98 / (download) - annotate - [select for diffs], Sat Nov 19 13:17:44 2011 UTC (12 years, 6 months ago) by schwarze
Branch: MAIN
Changes since 1.97: +9 -1 lines
Diff to previous 1.97 (colored)

Avoid a NULL pointer access if an .Rs block body contains nothing
but invalid nodes.  Output still differs a lot from groff, but at
least let's not crash.
Problem found and patch provided by joerg@, thanks!

Revision 1.97 / (download) - annotate - [select for diffs], Wed Nov 16 19:47:58 2011 UTC (12 years, 6 months ago) by schwarze
Branch: MAIN
Changes since 1.96: +6 -1 lines
Diff to previous 1.96 (colored)

When processing .Sh HEAD, as soon as we know which section this is,
fix up the section attributes of the HEAD, it's parent BLOCK, and
all its (text) children.  This is required because the section
attributes get set when each node is allocated, i.e. before processing
the content of the node itself.  Thus, the listed nodes got the section
attribute of the preceding section.  No need to fix up the BODY, all
is fine there already.
Found while implementing TYPE_Sh for mandocdb(8).

Revision 1.96 / (download) - annotate - [select for diffs], Sun Oct 16 12:18:32 2011 UTC (12 years, 7 months ago) by schwarze
Branch: MAIN
Changes since 1.95: +5 -6 lines
Diff to previous 1.95 (colored)

Remove a bunch of useless assignments,
and assert that print_bvspace cannot be called on NULL pointers.
No change in behaviour, none of these were bugs,
but the code becomes easier to understand.
Based on a clang report posted by joerg@; ok kristaps@.

Revision 1.95 / (download) - annotate - [select for diffs], Sun Sep 18 15:54:48 2011 UTC (12 years, 8 months ago) by schwarze
Branch: MAIN
Changes since 1.94: +52 -71 lines
Diff to previous 1.94 (colored)

sync to version 1.11.7 from kristaps@
main new feature: support the roff(7) .tr request
plus various bugfixes and some refactoring

regressions are so minor that it's better to get this in
and fix them in the tree

Revision 1.94 / (download) - annotate - [select for diffs], Sun Sep 18 10:25:28 2011 UTC (12 years, 8 months ago) by schwarze
Branch: MAIN
Changes since 1.93: +2 -2 lines
Diff to previous 1.93 (colored)

sync to version 1.11.5:
adding an implementation of the eqn(7) language
by kristaps@

So far, only .EQ/.EN blocks are handled, in-line equations are not, and
rendering is not yet very pretty, but the parser is fairly complete.

Revision 1.93 / (download) - annotate - [select for diffs], Sun May 29 21:22:18 2011 UTC (12 years, 11 months ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_5_0_BASE, OPENBSD_5_0
Changes since 1.92: +22 -14 lines
Diff to previous 1.92 (colored)

Merge release 1.11.3, almost all code by kristaps@:
* Unicode output support (no Unicode input yet, though).
* Refactoring: completely handle predefined strings in roff.c.
- New function mandoc_escape() replaces a2roffdeco() and mandoc_special().
- Start using mandoc_getarg() in mdoc_argv.c.
- Clean up parsing of delimiters in mdoc(7).
* And many minor fixes and lots of cleanup.

Revision 1.92 / (download) - annotate - [select for diffs], Sun Apr 24 16:22:02 2011 UTC (13 years ago) by schwarze
Branch: MAIN
Changes since 1.91: +15 -14 lines
Diff to previous 1.91 (colored)

Merge version 1.11.1:
Again lots of cleanup and maintenance work by kristaps@.
- simplify error reporting: less function pointers, more mandoc_[v]msg
- main: split document parsing out of main.c into read.c
- roff, mdoc, man: improved recognition of control characters
- roff: better handling of if/else stack overflows
- roff: add some predefined strings for backward compatibility
- mdoc, man: empty sections are not errors
- mdoc: move delimiter handling to libmdoc
- some header restructuring and some minor features and fixes
This merge causes two minor regressions
that i will fix in separate commits right afterwards.

Revision 1.91 / (download) - annotate - [select for diffs], Thu Apr 21 22:59:54 2011 UTC (13 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.90: +143 -13 lines
Diff to previous 1.90 (colored)

Merge version 1.10.10:
lots of cleanup and maintenance work by kristaps@.
- move some main.c globals into struct curparse
- move mandoc_*alloc to mandoc.h such that all code can use them
- make mandoc_isdelim available to formatting frontends
- dissolve mdoc_strings.c, move the code where it is used
- make all error reporting functions void, their return values were useless
- and various minor cleanups and fixes

Revision 1.90 / (download) - annotate - [select for diffs], Sun Mar 20 23:36:42 2011 UTC (13 years, 2 months ago) by schwarze
Branch: MAIN
Changes since 1.89: +5 -1 lines
Diff to previous 1.89 (colored)

Import the foundation for eqn(7) support.
Written by kristaps@.

For now, i'm adding one line to each of the four frontends
to just pass the input text through to the output,
not yet interpreting any of then eqn keywords.

Revision 1.89 / (download) - annotate - [select for diffs], Mon Mar 7 01:35:33 2011 UTC (13 years, 2 months ago) by schwarze
Branch: MAIN
Changes since 1.88: +14 -15 lines
Diff to previous 1.88 (colored)

Clean up date handling,
as a first step to get rid of the frequent petty warnings in this area:
 - always store dates as strings, not as seconds since the Epoch
 - for input, try the three most common formats everywhere
 - for unrecognized format, just pass the date though verbatim
 - when there is no date at all, still use the current date
Originally triggered by a one-line patch from Tim van der Molen,
<tbvdm at xs4all dot nl>, which is included here.
Feedback and OK on manual parts from jmc@.
"please check this in" kristaps@

Revision 1.88 / (download) - annotate - [select for diffs], Sun Feb 6 17:33:21 2011 UTC (13 years, 3 months ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_4_9_BASE, OPENBSD_4_9
Changes since 1.87: +13 -2 lines
Diff to previous 1.87 (colored)

If .Ns is specified on its own line, ignore it, like groff does;
from kristaps@.

Revision 1.87 / (download) - annotate - [select for diffs], Sun Jan 30 18:28:01 2011 UTC (13 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.86: +22 -2 lines
Diff to previous 1.86 (colored)

Make .Bx accept not more than two arguments.
Convert the first character of the second argument to uppercase.
Append the second argument with a hyphen.
Improves chpass(1), column(1), fstat(1), ...
from kristaps@

Revision 1.86 / (download) - annotate - [select for diffs], Sun Jan 30 17:41:59 2011 UTC (13 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.85: +3 -3 lines
Diff to previous 1.85 (colored)

Like in groff, if .%B is specified, quote .%T; from kristaps@.

Revision 1.85 / (download) - annotate - [select for diffs], Sat Jan 22 13:55:50 2011 UTC (13 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.84: +21 -37 lines
Diff to previous 1.84 (colored)

Check argument count validation for all in_line() macros.
Most empty in_line() macros are already removed by the parser,
so there is no need to check again in mdoc_validate.c.
This also downgrades almost all remaining argument count issues
from ERROR to WARNING.
ok kristaps@

Revision 1.84 / (download) - annotate - [select for diffs], Tue Jan 4 22:28:17 2011 UTC (13 years, 4 months ago) by schwarze
Branch: MAIN
Changes since 1.83: +18 -23 lines
Diff to previous 1.83 (colored)

Merge kristaps@' cleaner tbl integration, removing mine;
there are still a few bugs, but fixing these will be easier in tree.

Revision 1.83 / (download) - annotate - [select for diffs], Mon Jan 3 23:39:27 2011 UTC (13 years, 4 months ago) by schwarze
Branch: MAIN
Changes since 1.82: +66 -65 lines
Diff to previous 1.82 (colored)

Partial cleanup of argument count validation in mdoc(7):

* Do not segfault on empty .Db, .Rs, .Sm, and .St.
* Let check_count() really throw the requested level, not always ERROR.
* Downgrade most bad argument counts from ERROR to WARNING.
* And some related internal cleanup.

Looks fine to kristaps@.

Note that the macros using eerr_ge1() still need to be checked at a later
time; but as all the others are done, let's use what we already have.

Revision 1.82 / (download) - annotate - [select for diffs], Wed Dec 29 00:47:31 2010 UTC (13 years, 4 months ago) by schwarze
Branch: MAIN
Changes since 1.81: +62 -93 lines
Diff to previous 1.81 (colored)

Reorg by Kristaps:  In libmdoc, replace the union of pointers to structs
of macro-specific data by a pointer to a union of structs, which makes the
code simpler and more robust at the expense of a small memory overhead.
Merging was somewhat difficult because we mustn't break tbl(1) support
which the bsd.lv version does not yet have.

Revision 1.81 / (download) - annotate - [select for diffs], Sun Dec 26 21:04:19 2010 UTC (13 years, 4 months ago) by schwarze
Branch: MAIN
Changes since 1.80: +17 -2 lines
Diff to previous 1.80 (colored)

Behave more like groff (both old and new): Specifying both .%T and .%J in
an .Rs block causes the title to be quoted instead of underlined, such
that journal title and article title appear visually different.
Original diff from kristaps@, simplified by me, tweaked again by kristaps@.

Revision 1.80 / (download) - annotate - [select for diffs], Tue Dec 21 23:57:31 2010 UTC (13 years, 5 months ago) by schwarze
Branch: MAIN
Changes since 1.79: +8 -5 lines
Diff to previous 1.79 (colored)

Migrate .An to use a pointer to its data, like everybody else.
In preparation for a simpler ref-counted system for node data.
From kristaps@.

Revision 1.79 / (download) - annotate - [select for diffs], Tue Dec 21 23:46:18 2010 UTC (13 years, 5 months ago) by schwarze
Branch: MAIN
Changes since 1.78: +45 -21 lines
Diff to previous 1.78 (colored)

Vertical spacing improvements from kristaps@, small tweaks by me:
Add a "last child" member to struct mdoc_node.
Remove .Pp or .Lp if it is the first or last child of an .Sh or .Ss body.
Thus, no need to do the same in the front-ends any longer.
Tolerate some cases of .Pp inside .Bl.

Revision 1.78 / (download) - annotate - [select for diffs], Thu Dec 9 21:29:17 2010 UTC (13 years, 5 months ago) by schwarze
Branch: MAIN
Changes since 1.77: +10 -10 lines
Diff to previous 1.77 (colored)

Allow quote macros (`Op', `Aq', `Bq', `Dq', `Pq', `Ql', `Qq', `Sq', and
`Brq') to have zero arguments without warning.  This makes sense because
the multi-line quote macros (`Oo/Oc' etc.) allow zero children anyway.
Furthermore, the documentation doesn't state that they're required to
have children.

Reported by Alex Kozlov, patch from kristaps@.

Revision 1.77 / (download) - annotate - [select for diffs], Tue Dec 7 00:08:52 2010 UTC (13 years, 5 months ago) by schwarze
Branch: MAIN
Changes since 1.76: +3 -3 lines
Diff to previous 1.76 (colored)

Complete the merge of bsd.lv version 1.10.7:
No more functional changes, just sync ordering, comments and white space.

Revision 1.76 / (download) - annotate - [select for diffs], Wed Dec 1 22:02:29 2010 UTC (13 years, 5 months ago) by schwarze
Branch: MAIN
Changes since 1.75: +1023 -323 lines
Diff to previous 1.75 (colored)

Merge mdoc_action.c into mdoc_validate.c, because having two places to do
basically the same things just causes code duplication and confusion.
Work by kristaps@, including a few bugfixes he found during the merge,
and reapplying OpenBSD changes on top.

Revision 1.75 / (download) - annotate - [select for diffs], Tue Oct 26 22:48:07 2010 UTC (13 years, 6 months ago) by schwarze
Branch: MAIN
Changes since 1.74: +4 -6 lines
Diff to previous 1.74 (colored)

Downgrade nearly 20 ERRORS to WARNINGS.
All these indicate problems in the mdoc(7) or man(7) source code,
but they can't cause relevant information loss or clobbered formatting.
While here, error message improve wording and make it more uniform,
don't throw MANDOCERR_NOWIDTHARG twice when there is one single issue,
and consolidate MANDOCERR_WIDTHARG into MANDOCERR_IGNARGV.

Revision 1.74 / (download) - annotate - [select for diffs], Sun Oct 24 18:15:43 2010 UTC (13 years, 6 months ago) by schwarze
Branch: MAIN
Changes since 1.73: +4 -8 lines
Diff to previous 1.73 (colored)

Do not throw FATAL errors when there is no need to:
 - when encountering nested displays (.Bd containing .Bd, .D1, .D1)
 - when a block end macro was forgotten
 - when ending a block that was never started
 - when the uname(3) system call failed
along with a little related cleanup

Revision 1.73 / (download) - annotate - [select for diffs], Sat Oct 23 17:04:51 2010 UTC (13 years, 6 months ago) by schwarze
Branch: MAIN
Changes since 1.72: +6 -5 lines
Diff to previous 1.72 (colored)

use proper message in case of multiple arguments to .An
from kristaps@

Revision 1.72 / (download) - annotate - [select for diffs], Sat Oct 23 16:40:15 2010 UTC (13 years, 6 months ago) by schwarze
Branch: MAIN
Changes since 1.71: +130 -88 lines
Diff to previous 1.71 (colored)

cleanup mdoc(7) validation code: use real functions, not macros
from kristaps@

Revision 1.71 / (download) - annotate - [select for diffs], Sat Oct 16 13:38:29 2010 UTC (13 years, 7 months ago) by schwarze
Branch: MAIN
Changes since 1.70: +3 -1 lines
Diff to previous 1.70 (colored)

Support tbl(1) code embedded into mdoc(7) input files.
Very similar to what i have done in man(7) yesterday.
Allows to build cpu(4) on HPPA, wi(4), and phantasia(6).
Now we are able to build all tbl code in base.

Revision 1.70 / (download) - annotate - [select for diffs], Mon Sep 27 21:25:28 2010 UTC (13 years, 7 months ago) by schwarze
Branch: MAIN
Changes since 1.69: +30 -5 lines
Diff to previous 1.69 (colored)

Merge the last bits of 1.10.6 (released today), most were already in:
* ignore double-.Pp
* ignore .Pp before .Bd and .Bl (unless -compact in specified)
* avoid double blank line upon .Pp, .br and friends in literal context
* cast enums to int when passing them to exit(3) to please lint(1)
While merging, fix a regression introduced by kristaps@:
Outside literal mode, double blank lines must both be printed.
To achieve this again after kristaps@ improvements in 1.10.6,
treat such blank lines as .sp (instead of .Pp as in 1.10.5)
and drop .Pp before .sp just like dropping .Pp before .Pp.

Revision 1.69 / (download) - annotate - [select for diffs], Mon Sep 20 19:48:21 2010 UTC (13 years, 8 months ago) by schwarze
Branch: MAIN
Changes since 1.68: +4 -4 lines
Diff to previous 1.68 (colored)

Make .Pp .Lp .br not FATAL when having arguments;
From kristaps@

Revision 1.68 / (download) - annotate - [select for diffs], Fri Aug 20 00:53:35 2010 UTC (13 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.67: +3 -7 lines
Diff to previous 1.67 (colored)

Implement a simple, consistent user interface for error handling.
We now have sufficient practical experience to know what we want,
so this is intended to be final:
- provide -Wlevel (warning, error or fatal) to select what you care about
- provide -Wstop to stop after parsing a file with warnings you care about
- provide consistent exit status codes for those warnings you care about
- fully document what warnings, errors and fatal errors mean
- remove all other cruft from the user interface, less is more:
- remove all -f knobs along with the whole -f option
- remove the old -Werror because calling warnings "fatal" is silly
- always finish parsing each file, unless fatal errors prevent that
This commit also includes a couple of related simplifications behind
the scenes regarding error handling.
Feedback and OK  kristaps@;  Joerg Sonnenberger (NetBSD) and
Sascha Wildner (DragonFly BSD) agree with the general direction.

Revision 1.67 / (download) - annotate - [select for diffs], Sat Jul 31 21:43:07 2010 UTC (13 years, 9 months ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_4_8_BASE, OPENBSD_4_8
Changes since 1.66: +2 -2 lines
Diff to previous 1.66 (colored)

Merge bsd.lv version 1.10.5: last larger batch of bug fixes before release.
NOT including Kristaps' .Bd -literal changes which cause regressions.
Features:
* -Tpdf now fully working
Bugfixes:
* proper handling of quoted strings by .ds in roff(7)
* allow empty .Dd
* make .Sm start no-spacing after the first output word
* underline .Ad
* minor fixes in -Thtml
and some optimisations in terminal output.

Revision 1.66 / (download) - annotate - [select for diffs], Sun Jul 25 18:05:54 2010 UTC (13 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.65: +23 -22 lines
Diff to previous 1.65 (colored)

Sync to bsd.lv; in particular, pull in lots of bug fixes.
new features:
* support the .in macro in man(7)
* support minimal PDF output
* support .Sm in mdoc(7) HTML output
* support .Vb and .nf in man(7) HTML output
* complete the mdoc(7) manual
bug fixes:
* do not let mdoc(7) .Pp produce a newline before/after .Sh; reported by jmc@
* avoid double blank lines related to man(7) .sp and .br
* let man(7) .nf and .fi flush the line; reported by jsg@ and naddy@
* let "\ " produce a non-breaking space; reported by deraadt@
* discard \m colour escape sequences; reported by J.C. Roberts
* map undefined 1-character-escapes to the literal character itself
maintenance:
* express mdoc(7) arguments in terms of an enum for additional type-safety
* simplify mandoc_special() and a2roffdeco()
* use strcspn in term_word() in place of a manual loop
* minor optimisations in the -Tps and -Thtml formatting frontends

Revision 1.65 / (download) - annotate - [select for diffs], Tue Jul 13 01:09:13 2010 UTC (13 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.64: +159 -101 lines
Diff to previous 1.64 (colored)

Merge release 1.10.4 (all code by kristaps@), providing four new features:
1) Proper .Bk support: allow output line breaks at input line breaks,
but keep input lines together in the output, finally fixing
synopses like aucat(1), mail(1) and tmux(1).
2) Mostly finished -Tps (PostScript) output.
3) Implement -Thtml output for .Nm blocks and .Bk -words.
4) Allow iterative interpolation of user-defined roff(7) strings.
Also contains some minor bugfixes and some performance improvements.

Revision 1.64 / (download) - annotate - [select for diffs], Fri Jul 2 17:41:05 2010 UTC (13 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.63: +4 -7 lines
Diff to previous 1.63 (colored)

Not only for -tag lists, but for -hang, -ohang, -inset, -diag,
and -item list as well, empty bodies are OK, they do not even
warrant a warning, much less the error they were throwing.
According to kristaps, joerg@ also brought this up some time ago.
ok kristaps@ jmc@

Revision 1.63 / (download) - annotate - [select for diffs], Sun Jun 27 21:54:42 2010 UTC (13 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.62: +3 -1 lines
Diff to previous 1.62 (colored)

Full .nr nS support, unbreaking the kernel manuals.

Kristaps coded this from scratch after reading my .nr patch;
it is simpler and more powerful.

Registers live in struct regset in regs.h, struct man and struct mdoc
contain pointers to it.  The nS register is cleared when parsing .Sh.
Frontends respect the MDOC_SYNPRETTY flag set in mdoc node_alloc.

Revision 1.62 / (download) - annotate - [select for diffs], Sun Jun 27 17:49:58 2010 UTC (13 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.61: +4 -4 lines
Diff to previous 1.61 (colored)

minor .Bk fixes:
* do not print invalid arguments verbatim (no groffs prints them, either)
* do not trigger TERMP_PREKEEP twice
* do not die from invlid arguments (groff won't die, either)
* continue to ignore even valid arguments (just like groff)
ok kristaps@ on the previous version, before removing my last bug ;)

Revision 1.61 / (download) - annotate - [select for diffs], Sat Jun 26 17:56:43 2010 UTC (13 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.60: +124 -60 lines
Diff to previous 1.60 (colored)

merge release 1.10.2
* bug fixes:
- interaction of ASCII_HYPH with special chars (found by Ulrich Spoerlein)
- handling of roff conditionals (found by Ulrich Spoerlein)
- .Bd -offset will no more default to 6n
* maintenance:
- more caching of .Bd and .Bl arguments for efficiency
- deconstify man(7) validation routines
- add FreeBSD library names (provided by Ulrich Spoerlein)
* start PostScript font-switching

Revision 1.60 / (download) - annotate - [select for diffs], Sun Jun 6 20:30:08 2010 UTC (13 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.59: +187 -152 lines
Diff to previous 1.59 (colored)

Merge bsd.lv version 1.10.1 (to be released soon).

The main step forward is that this now has *much* better .Bl -column
support, now supporting many manuals that previously errored out
without producing any output.

Other fixes include:
* do not die from multiple list types, use the first and warn
* in .Bl without a type, default to -item
* various tweaks to .Dt
* fix .In, .Fd, .Ft, .Fn and .Fo formatting
* some documentation fixes and additions
* and fix a couple of bugs reported by Ulrich Spoerlein:
* better support for roff block-end "\}" without a preceding dot
* .In must not break the line outside SYNOPSIS
* spelling in some error messages

While merging, fix one regression in .In spacing
that needs to go to bsd.lv, too.

Revision 1.59 / (download) - annotate - [select for diffs], Sun Jun 6 18:08:41 2010 UTC (13 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.58: +18 -8 lines
Diff to previous 1.58 (colored)

Merge bsd.lv release 1.10.0,
which is mostly the post-hackathon release,
bringing in the OpenBSD changes to bsd.lv,
but which also has a few additional minor fixes:

* .Lb is an in-line macro, not in_line_eoln
* .Bt, .Ud now warn when discarding arguments
* allow bad -man dates to flow verbatim into the front-ends
- so far all reported by Ulrich Spoerlein
* .Ar, .Fl and .Li starting with closing punctuation emit an empty element
* empty .Li macros print nothing, but may cause spacing
* proper EOS handling for .Bt, .Ex, .Rv, and .Ud.
* cleanup: collapse posts_xr into posts_wtext (which is the same)
* efficiency: very simple table lookup for roff.c

Revision 1.58 / (download) - annotate - [select for diffs], Wed May 26 02:39:58 2010 UTC (13 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.57: +2 -2 lines
Diff to previous 1.57 (colored)

When a word does not fully fit onto the output line, but it contains
at least one hyphen, we already had support for breaking the line a the
last fitting hyphen.  This patch improves this functionality by only
breaking at hyphens in free-form text, and by not breaking at hyphens
* at the beginning or end of a word   or
* immediately preceded or followed by another hyphen   or
* escaped by a preceding backslash.

Before this patch, differences in break-at-hyphen support were one
of the major sources of noise in automatic comparisons to mdoc(7)
groff output.  Now, the remaining differences are hard to find among
the noise coming from other sources.

Where there are still differences, what we do seems to be better than
what groff does, see e.g. the chio(1) exchange and position commands
for one of the now rare examples.

idea and coding by kristaps@

Besides, this was the last substantial code difference left
between bsd.lv and openbsd.org.  We are now in full sync.

Revision 1.57 / (download) - annotate - [select for diffs], Mon May 24 12:48:11 2010 UTC (13 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.56: +5 -4 lines
Diff to previous 1.56 (colored)

lift 64-byte max width for Sh (now BUFSIZ); from kristaps@

Revision 1.56 / (download) - annotate - [select for diffs], Mon May 24 00:00:10 2010 UTC (13 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.55: +12 -20 lines
Diff to previous 1.55 (colored)

Increase performance by saving the list type in struct mdoc_node.
This will eventually be used so that mdoc_macro can know whether to
dump list line arguments into the body (`Bl -column' overflowing).
Remove a2list() and arg_listtype() because of this.

From kristaps@.

While merging, fix a regression in mdoc_term.c, print_bvspace():
The bsd.lv version of this broke vertical spacing in .Bl -column.

Revision 1.55 / (download) - annotate - [select for diffs], Sun May 23 22:45:01 2010 UTC (13 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.54: +149 -99 lines
Diff to previous 1.54 (colored)

Unified error and warning message system for all of mandoc,
featuring three message levels, as agreed during the mandoc hackathon:
* FATAL parser failure, cannot produce any output from this input file:
  eventually, we hope to convert most of these to ERRORs.
* ERROR, meaning mandoc cannot cope fully with the input syntax and will
  probably lose information or produce structurally garbled output;
  it will try to produce output anyway but exit non-zero at the end,
  which is eventually intended to make the ports infrastructure happy.
* WARNING, meaning you should clean up the input file, but output
  is probably mostly OK, so this will not cause error-exit at the end.
This commit is mostly just converting the old system to the new one; before
the classification will become really reliable, we must check all messages.

In particular,
* set up a new central message string table in main.c
* drop the old message string tables from man.c and mdoc.c
* get rid of the piece-meal merr enums in libman and libmdoc
* reduce number of error/warning functions from 16 to 6 (still a lot...)

While here, handle a few problems more gracefully:
* allow .Rv and .Ex to work without a prior .Nm
* allow .An to ignore extra arguments
* allow undeclared columns in .Bl -column

Written by kristaps@.

Revision 1.54 / (download) - annotate - [select for diffs], Sat May 15 18:25:51 2010 UTC (14 years ago) by schwarze
Branch: MAIN
Changes since 1.53: +9 -10 lines
Diff to previous 1.53 (colored)

allow non-numeric manual sections in -mdoc;
while here, allow LIBRARY in section 9;
by kristaps@

Revision 1.53 / (download) - annotate - [select for diffs], Sat May 15 16:48:12 2010 UTC (14 years ago) by schwarze
Branch: MAIN
Changes since 1.52: +8 -86 lines
Diff to previous 1.52 (colored)

various improvements regarding errors and warnings Joerg Sonnenberger:
* If the last -column .Bl isn't specified, it is auto-sized.
* An invalid .St argument should be a warning, not an error.
  Just put the argument into the output.
* An invalid .At argument should be a warning, not an error.
  Just print the argument, like new groff does.
* Remove warnings concerning manual section (like 1, 6, 8).
  It was only used for .Ex and not really useful.
* Remove warnings concerning page section (like SYNOPSIS).
  These were only used for .Fd and .Lb and not really useful.

Revision 1.52 / (download) - annotate - [select for diffs], Fri May 14 19:52:43 2010 UTC (14 years ago) by schwarze
Branch: MAIN
Changes since 1.51: +2 -4 lines
Diff to previous 1.51 (colored)

Integrate kristaps@' end-of-sentence (EOS) framework
which is simpler and more powerful than mine, and remove mine.

* man(7) now has EOS handling, too
* put EOS detection into its own function in libmandoc
* use node and termp flags to communicate the EOS condition
* no more EOS pseudo-macro
* no more non-printable EOS marker character on the formatter level

This slightly breaks EOS detection after trailing punctuation
in mdoc(7) macros, but that will be restored soon.

Revision 1.51 / (download) - annotate - [select for diffs], Fri May 14 14:47:44 2010 UTC (14 years ago) by schwarze
Branch: MAIN
Changes since 1.50: +8 -5 lines
Diff to previous 1.50 (colored)

Merge 1.9.25, keeping local patches;
this does not merge kristaps' end-of-sentences handling yet,
i will check that separately.  This one includes:
* handle \*(Ba as a delimiter
* introduce ARGS_PEND for .Bl -column .It end-of-line special casing
* section ordering: expect EXIT STATUS at the right place
* line break fixes in SYNOPSIS
* allow literal contexts to have arbitrary line lengths
* the input file column number can not be used to identify the beginning
  of a line because white space is allowed after the initial '.'
* proper leading spaces in -man -Tascii mode
* do not let Lb break lines in -mdoc -Thtml LIBRARY

Revision 1.50 / (download) - annotate - [select for diffs], Fri May 14 01:54:37 2010 UTC (14 years ago) by schwarze
Branch: MAIN
Changes since 1.49: +3 -15 lines
Diff to previous 1.49 (colored)

merge 1.9.24, keeping local patches; some changes:
* preserve multiple consecutive space characters in input
* do not restrict .Cd and .Rv to certain sections (requested by Joerg)
* do not run lookup() on quoted words
* enum return types for mdoc_args and mdoc_argv
* fix auto-closing of LINK tag in -Txhtml (from Daniel Friesel)
* various lint and manual fixes

Revision 1.49 / (download) - annotate - [select for diffs], Thu May 13 20:34:29 2010 UTC (14 years ago) by schwarze
Branch: MAIN
Changes since 1.48: +3 -14 lines
Diff to previous 1.48 (colored)

Remove the command line option -fno-ign-chars.
This option was not useful, you never want mandoc to die
just because there is an invalid character in the input file,
neither in production nor when linting: a warning is sufficient.
This was particularly annoying because it was part of -fstrict
and could not be switched off.
"less is more" kristaps@

Revision 1.48 / (download) - annotate - [select for diffs], Wed Apr 7 23:15:05 2010 UTC (14 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.47: +27 -23 lines
Diff to previous 1.47 (colored)

Merge the good parts of 1.9.23,
avoid the bad parts of 1.9.23, and keep local patches.

Input in general:
 * Basic handling of roff-style font escapes \f, \F.
 * Quoted punctuation does not count as punctuation.

mdoc(7) parser:
 * Make .Pf callable; noted by Claus Assmann.
 * Let .Bd and .Bl ignore unknown arguments; noted by deraadt@.
 * Do not warn when .Er is used outside certain sections.
 * Replace mdoc_node_free[list] by mdoc_node_delete.
 * Replace #define by enum for rew*() return values.

man(7) parser:
 * When .TH is missing, use default section and date.

Output in general:
 * Curly braces do not count as punctuation.
 * No space after .Fl w/o args when a macro follows on the same line.

HTML output:
 * Unify PAIR_*_INIT macros, introduce new PAIR_ID_INIT().
 * Print whitespace after, not before .Vt .Fn .Ft .Fo.

Checked that all manuals in base still build.

Revision 1.47 / (download) - annotate - [select for diffs], Sat Apr 3 17:06:19 2010 UTC (14 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.46: +2 -2 lines
Diff to previous 1.46 (colored)

no need to die from .Xr without arguments, we can just ignore it

ok deraadt@

Revision 1.46 / (download) - annotate - [select for diffs], Sat Apr 3 16:30:42 2010 UTC (14 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.45: +6 -2 lines
Diff to previous 1.45 (colored)

When two conflicting list types are specified for the same list,
use the first, discard the second, and warn.  No need to bail out.

ok deraadt@

Revision 1.45 / (download) - annotate - [select for diffs], Sat Apr 3 16:24:17 2010 UTC (14 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.44: +4 -3 lines
Diff to previous 1.44 (colored)

* outside literal context in mdoc(7), handle blank lines like .Pp
* a missing NAME section in mdoc(7) need not be fatal

ok deraadt@

Revision 1.44 / (download) - annotate - [select for diffs], Fri Apr 2 12:39:47 2010 UTC (14 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.43: +3 -3 lines
Diff to previous 1.43 (colored)

merge 1.9.22, keeping local patches
* convert mdoc tokens from #define to enum
* fix a segfault with .Xo/.Xc in explicit blocks
* Thorn is \*(Th, not \*(TH; noticed by Joerg Sonnenberger

Revision 1.43 / (download) - annotate - [select for diffs], Tue Mar 2 00:38:59 2010 UTC (14 years, 2 months ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_4_7_BASE, OPENBSD_4_7
Changes since 1.42: +4 -2 lines
Diff to previous 1.42 (colored)

Proper inter-sentence spacing for mdoc(7).
When a text line or a non-block macro line in the source code ends
in any of ".!?", consider that an end of sentence (EOS).
This makes Jason's rule "new sentence, new line" even more important.
Let the parser detect the EOS and insert a token into the AST.
Let the -Tascii frontend render the EOS token as a double space before
the next word.

Revision 1.42 / (download) - annotate - [select for diffs], Thu Feb 18 02:11:26 2010 UTC (14 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.41: +31 -5 lines
Diff to previous 1.41 (colored)

sync to release 1.9.15:
 * corrected .Vt handling (spotted by Joerg Sonnenberger)
 * corrected .Xr argument handling (based on my patch)
 * removed \\ escape sequence (because it is for low-level roff only)
 * warn about trailing whitespace (suggested by jmc@)
 * -Txhtml support
 * and some general cleanup and doc improvements

Revision 1.41 / (download) - annotate - [select for diffs], Fri Jan 1 22:20:24 2010 UTC (14 years, 4 months ago) by schwarze
Branch: MAIN
Changes since 1.40: +11 -4 lines
Diff to previous 1.40 (colored)

.Bl may have .Sm as a child.
The comment in the source code and OK by kristaps@;
merged upstream in rev. 1.55.

Revision 1.40 / (download) - annotate - [select for diffs], Wed Dec 23 22:30:17 2009 UTC (14 years, 4 months ago) by schwarze
Branch: MAIN
Changes since 1.39: +6 -2 lines
Diff to previous 1.39 (colored)

sync to 1.9.13: minor fixes:

correctness/functionality:
 - bugfix: properly ignore lines with only a dot in -man
 - bugfix: .Bl -ohang doesn't allow -width, warn about this
 - improve date string handling by new function mandoc_a2time
 - some HTML improvements
 - significant documentation additions in man.7 and mdoc.7

portability:
 - replace __dead by __attribute__((noreturn))
 - bugfix: correct .Dx rendering
 - some more library names for NetBSD

simplicity:
 - replace hand-rolled putchar(3)-loops by fwrite(3)
 - replace single-character printf(3) by putchar(3)

Revision 1.39 / (download) - annotate - [select for diffs], Tue Dec 22 23:58:00 2009 UTC (14 years, 4 months ago) by schwarze
Branch: MAIN
Changes since 1.38: +1 -2 lines
Diff to previous 1.38 (colored)

sync to 1.9.12, mostly portability and refactoring:

correctness/functionality:
- bugfix: do not die when overstep hits the right margin
- new option: -fign-escape
- and various HTML features

portability:
- replace bzero(3) by memset(3), which is ANSI C
- replace err(3)/warn(3) by perror(3)/exit(3), which is ANSI C
- iuse argv[0] instead of __progname
- add time.h to various files for FreeBSD compilation

simplicity:
- do not allocate header/footer data dynamically in *_term.c
- provide and use malloc frontends that error out on failure

for full changelogs, see http://bsd.lv/cgi-bin/cvsweb.cgi/

Revision 1.38 / (download) - annotate - [select for diffs], Tue Oct 27 21:40:07 2009 UTC (14 years, 6 months ago) by schwarze
Branch: MAIN
Changes since 1.37: +10 -6 lines
Diff to previous 1.37 (colored)

sync to 1.9.11: adapt printing of dates to groff conventions,
NetBSD portability fixes and some minor bugfixes and feature enhancements;
also checked that my hyphenation code still works on top of this

Revision 1.37 / (download) - annotate - [select for diffs], Wed Oct 21 19:13:51 2009 UTC (14 years, 7 months ago) by schwarze
Branch: MAIN
Changes since 1.36: +20 -44 lines
Diff to previous 1.36 (colored)

sync to 1.9.9, featuring:
 * -Thtml output mode
 * roff scaling units
 * and some minor fixes
for full changelogs, see http://bsd.lv/cgi-bin/cvsweb.cgi/

Revision 1.36 / (download) - annotate - [select for diffs], Mon Oct 19 16:27:52 2009 UTC (14 years, 7 months ago) by schwarze
Branch: MAIN
Changes since 1.35: +49 -5 lines
Diff to previous 1.35 (colored)

sync to 1.9.6: multiple improvements to references (.Rs)
 * validate and order .Rs child nodes
 * underline book title (.%B) and issuer (.%I)
 * enclose title of article (.%T) in quotes
 * avoid calling mdoc_verr directly, use a proper error code instead

Revision 1.35 / (download) - annotate - [select for diffs], Sat Aug 22 22:50:17 2009 UTC (14 years, 8 months ago) by schwarze
Branch: MAIN
Changes since 1.34: +3 -16 lines
Diff to previous 1.34 (colored)

sync to 1.9.1: .Rv and .Ex accept multiple arguments

Revision 1.34 / (download) - annotate - [select for diffs], Sun Aug 9 21:49:45 2009 UTC (14 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.33: +3 -2 lines
Diff to previous 1.33 (colored)

sync to 1.8.4: correct error message to complain about .An line arguments

Revision 1.33 / (download) - annotate - [select for diffs], Sun Aug 9 20:11:30 2009 UTC (14 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.32: +2 -2 lines
Diff to previous 1.32 (colored)

sync to 1.8.3: In .Bl -column, handle one column in excess,
but still issue a warning

Revision 1.32 / (download) - annotate - [select for diffs], Sun Aug 9 17:38:24 2009 UTC (14 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.31: +14 -5 lines
Diff to previous 1.31 (colored)

sync to 1.8.2: more .Bl -column fixes, in particular:
1) -column implies -compact
2) do not die from fewer columns than specified (more are still fatal)

Revision 1.31 / (download) - annotate - [select for diffs], Sun Jul 26 01:59:46 2009 UTC (14 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.30: +40 -6 lines
Diff to previous 1.30 (colored)

sync to 1.8.1: support .br and .sp

Revision 1.30 / (download) - annotate - [select for diffs], Sun Jul 19 12:26:57 2009 UTC (14 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.29: +2 -2 lines
Diff to previous 1.29 (colored)

The abbreviation for .Bf -symbolic is .Bf Sy, not .Bf Sm;
"Gah! Fixed." kristaps@

Revision 1.29 / (download) - annotate - [select for diffs], Sat Jul 18 20:19:50 2009 UTC (14 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.28: +2 -2 lines
Diff to previous 1.28 (colored)

sync to 1.8.0: a bad .St argument causes an error, not a warning

Revision 1.28 / (download) - annotate - [select for diffs], Sat Jul 18 20:15:07 2009 UTC (14 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.27: +106 -113 lines
Diff to previous 1.27 (colored)

sync to 1.8.0: white space fixes, no code change

Revision 1.27 / (download) - annotate - [select for diffs], Sat Jul 18 19:44:38 2009 UTC (14 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.26: +11 -1 lines
Diff to previous 1.26 (colored)

sync to 1.8.0: move mdoc_a2att, mdoc_a2st, and mdoc_a2lib to libmdoc

Revision 1.26 / (download) - annotate - [select for diffs], Sat Jul 18 16:21:52 2009 UTC (14 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.25: +2 -2 lines
Diff to previous 1.25 (colored)

sync to 1.8.0: avoid duplicate warning about a malformed NAME section
when the next section following NAME is a custom section

Revision 1.25 / (download) - annotate - [select for diffs], Sat Jul 18 15:34:27 2009 UTC (14 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.24: +6 -3 lines
Diff to previous 1.24 (colored)

sync to 1.8.0: .Nd is now a BFI, was an ELEM,
and use \(en instead of \- for .Nd

Revision 1.24 / (download) - annotate - [select for diffs], Mon Jul 13 01:00:50 2009 UTC (14 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.23: +2 -2 lines
Diff to previous 1.23 (colored)

fix a trivial pasto that crept into 1.7.23; also submitted upstream

Revision 1.23 / (download) - annotate - [select for diffs], Mon Jul 13 00:33:40 2009 UTC (14 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.22: +5 -3 lines
Diff to previous 1.22 (colored)

sync to 1.7.24: mdoc_nwarn/mdoc_nerr got mixed up;
fix from joerg at netbsd via kristaps@

Revision 1.22 / (download) - annotate - [select for diffs], Sun Jul 12 23:19:48 2009 UTC (14 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.21: +2 -4 lines
Diff to previous 1.21 (colored)

sync to 1.7.24: make .In handling more similar to new groff

Revision 1.21 / (download) - annotate - [select for diffs], Sun Jul 12 22:35:08 2009 UTC (14 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.20: +27 -126 lines
Diff to previous 1.20 (colored)

sync to 1.7.23: pass warning code to mdoc_pwarn() instead of warning message
define additional warning macro mdoc_nwarn()
remove obsolete warning functions mdoc_warn(), pwarn(), vwarn(), nwarn()
remove various now unused "enum mdoc_warn" and "enum mwarn"

Revision 1.20 / (download) - annotate - [select for diffs], Sun Jul 12 21:45:44 2009 UTC (14 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.19: +5 -71 lines
Diff to previous 1.19 (colored)

sync to 1.7.23: pass error code to mdoc_perr() instead of error string
and use the so improved mdoc_nerr() at many places;
get rid of now unused static functions perr()

Revision 1.19 / (download) - annotate - [select for diffs], Sun Jul 12 21:08:29 2009 UTC (14 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.18: +31 -31 lines
Diff to previous 1.18 (colored)

sync to 1.7.23: pass error code to mdoc_nerr() instead of error string
and use the so improved mdoc_nerr() at many places

Revision 1.18 / (download) - annotate - [select for diffs], Sun Jul 12 20:30:27 2009 UTC (14 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.17: +7 -27 lines
Diff to previous 1.17 (colored)

sync to 1.7.23: unify the various "enum merr" into libman.h and libmdoc.h,
use it as a new argument to mdoc_err(), the same way as for for man_err(),
and use string tables instead of switch statements to select error messages

Revision 1.17 / (download) - annotate - [select for diffs], Sun Jul 12 19:05:52 2009 UTC (14 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.16: +10 -7 lines
Diff to previous 1.16 (colored)

sync to 1.7.23: third step to get rid of enum mdoc_warn:
mdoc_verr is not using enum mdoc_warn, so use it at a few more places

Revision 1.16 / (download) - annotate - [select for diffs], Sun Jul 12 18:35:57 2009 UTC (14 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.15: +2 -2 lines
Diff to previous 1.15 (colored)

sync to 1.7.23: second step to get rid of enum mdoc_warn:
remove type from mdoc_vwarn arguments, and use this function where apropriate

Revision 1.15 / (download) - annotate - [select for diffs], Wed Jul 8 00:04:10 2009 UTC (14 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.14: +7 -5 lines
Diff to previous 1.14 (colored)

sync to 1.7.21: unified escape sequence validation for mdoc and man
checking is still incomplete, but a bit better, in particular for man
now in sync with 1.7.22: the only 1.7.22 diff was already in

Revision 1.14 / (download) - annotate - [select for diffs], Mon Jul 6 22:33:58 2009 UTC (14 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.13: +1 -6 lines
Diff to previous 1.13 (colored)

remove unused WDEPCOL warning that became unused in 1.7.19
ok kristaps@  and contained in 1.7.21

Revision 1.13 / (download) - annotate - [select for diffs], Fri Jun 26 22:43:40 2009 UTC (14 years, 10 months ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_4_6_BASE, OPENBSD_4_6
Changes since 1.12: +1 -9 lines
Diff to previous 1.12 (colored)

the forms \*x, \*(xx and \*[xxx] are not deprecated, so revert most of 1.8;
noticed by jmc@;  ok kristaps@;  to be included in 1.7.21

Revision 1.12 / (download) - annotate - [select for diffs], Tue Jun 23 23:02:54 2009 UTC (14 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.11: +3 -18 lines
Diff to previous 1.11 (colored)

sync to 1.7.20: like for the -man case, add an nchild counter to the -mdoc
nodes, simplifying the validation code; no functional change

Revision 1.11 / (download) - annotate - [select for diffs], Sun Jun 21 19:09:58 2009 UTC (14 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.10: +34 -21 lines
Diff to previous 1.10 (colored)

sync to 1.7.19: .Bl -column  now correctly handles tail entries,
for example:  .Bl -column -compact -offset ... args ...

Revision 1.10 / (download) - annotate - [select for diffs], Sun Jun 21 18:15:03 2009 UTC (14 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.9: +16 -17 lines
Diff to previous 1.9 (colored)

sync to 1.7.19: kristaps@ rewrote post_bf to reduce nesting
no functional change

Revision 1.9 / (download) - annotate - [select for diffs], Fri Jun 19 07:20:19 2009 UTC (14 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.8: +22 -25 lines
Diff to previous 1.8 (colored)

sync to 1.7.19: more elegant section handling

Revision 1.8 / (download) - annotate - [select for diffs], Fri Jun 19 00:07:06 2009 UTC (14 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.7: +9 -3 lines
Diff to previous 1.7 (colored)

sync to 1.7.19: escape sequences of the forms \*x and \*(xx are deprecated

Revision 1.7 / (download) - annotate - [select for diffs], Thu Jun 18 23:34:53 2009 UTC (14 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.6: +2 -3 lines
Diff to previous 1.6 (colored)

sync to 1.7.19: improved comment handling

Revision 1.6 / (download) - annotate - [select for diffs], Thu Jun 18 21:08:29 2009 UTC (14 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.5: +2 -2 lines
Diff to previous 1.5 (colored)

sync to 1.7.16: The .Er macro may also be used in sections (3) and (9).

Revision 1.5 / (download) - annotate - [select for diffs], Thu Jun 18 20:59:49 2009 UTC (14 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.4: +62 -33 lines
Diff to previous 1.4 (colored)

sync to 1.7.16: use dedicated warning types for list validation
instead of hand-rolled warnings

Revision 1.4 / (download) - annotate - [select for diffs], Thu Jun 18 01:19:02 2009 UTC (14 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.3: +2 -2 lines
Diff to previous 1.3 (colored)

sync to 1.7.16: make a couple of macros callable, reserve "|",
and some tweaks to .Lk

Revision 1.3 / (download) - annotate - [select for diffs], Wed Jun 17 23:18:06 2009 UTC (14 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.2: +12 -13 lines
Diff to previous 1.2 (colored)

sync to 1.7.16: rename static function printwarn to warn_print

Revision 1.2 / (download) - annotate - [select for diffs], Sun Jun 14 23:00:57 2009 UTC (14 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.1: +11 -13 lines
Diff to previous 1.1 (colored)

sync to 1.7.16: comments, whitespace and spelling fixes; no functional change

Revision 1.1 / (download) - annotate - [select for diffs], Mon Apr 6 20:30:40 2009 UTC (15 years, 1 month ago) by kristaps
Branch: MAIN

Initial check-in of mandoc for formatting manuals. ok deraadt@

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.