| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
long obsolete and were never written in mdoc(7) in the first place.
Removes 100 lines from source files.
|
|
|
|
|
|
| |
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@.
|
| |
|
| |
|
|
|
|
| |
Fixing a NULL access jsg@ found with afl.
|
|
|
|
| |
no functional change, minus 15 lines of code.
|
|
|
|
| |
and some cleanup; no functional change, minus 70 lines.
|
|
|
|
| |
no functional change, minus 50 lines of code.
|
|
|
|
| |
No functional change, minus 130 lines of code.
|
|
|
|
| |
No functional change, minus 90 lines of code.
|
|
|
|
|
| |
Since this was the last remaining FATAL error in this area,
this change will allow major simplifications in the mdoc(7) parser.
|
|
|
|
|
|
|
|
| |
1. Correctly parse stray .Ec without preceding .Eo,
avoiding an assertion violation found by jsg@ with afl.
2. Correctly parse .Ec arguments when breaking another block.
3. Correct spacing around closing delimiter when breaking another block.
4. Sync some related formatting control from -Tascii to -Thtml.
|
|
|
|
|
| |
and not trigger an assertion when there is more than one argument;
the latter found by jsg@ with afl.
|
|
|
|
|
|
|
|
| |
Drop the FORM_GZ annotation in the mpages table; it is conceptually wrong
because it ought to be in the mlinks table: An uncompressed .so link file
can point to a compressed manual page file and vice versa.
Besides, it is no longer needed because mparse_open() handles it all.
Sprinkle some KNF while here.
|
| |
|
|
|
|
|
|
|
|
| |
and let mparse_open() fall back to .gz files
such that .so works even when the target is zipped,
requested by and in part using ideas from <bapt at FreeBSD>.
While here, make sure files are readable before forking,
both for efficiency and for better error reporting.
|
|
|
|
|
| |
Don't bother the user with the PID of the child process,
store it inside the opaque mparse handle.
|
| |
|
|
|
|
| |
fixing an assertion failure found by jsg@ with afl.
|
|
|
|
| |
to q.manpath and dropping the (incomplete) later NULL checks.
|
|
|
|
|
| |
Provides better groff compatibility.
From bentley@.
|
|
|
|
|
|
| |
* Do not allocate lines unless there are cells.
* Make the MANDOCERR_TBLNOLAYOUT message actually work.
Also get rid of one static function and two goto statements.
|
|
|
|
| |
from bentley@.
|
|
|
|
|
| |
which can for example happen for .Sh Xo .Sh without .Xc.
Crash found by jsg@ with afl.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
output handler because the high level terminal formatters could be
tricked into setting the left margin further to the right than the
right margin. Today, jsg@ found more of these with afl.
Change the internal interface between both levels, aiming for
simplicity and robustness of the code. Treat both margins as
*independent* settings: Now, termp.offset is the requested left
margin, and termp.rmargin is the available space. Let the lower
level cope with that case of insufficient space.
Obviously, high level code that does centering or flush right
still has to do careful checks, so i did a full audit of margin
settings in the terminal formatters.
Fixes crashes caused by excessively long title or date strings in
the man(7) footer, operating system or date strings in the mdoc(7)
footer, volume strings in the man(7) or mdoc(7) header, and a few
cases related to some non-prologue macros.
|
|
|
|
|
|
|
|
|
| |
underflow. Found while preparing an audit of termp.rmargin.
Overflow can also happen, but i see no sane way to deal with it,
so just let it happen. It doesn't happen for any sane input anyway,
groff behaviour is undefined, and the resulting values are legal,
even though they are useless.
|
| |
|
|
|
|
|
| |
1. The first argument of .Fn is not supposed to be parsed.
2. The .Fn macro is not supposed to reopen its scope after punctuation.
|
|
|
|
| |
just like groff; minibug noticed by bentley@.
|
|
|
|
|
|
| |
1. Do not mask out NAME_FIRST before its first use.
2. Avoid duplicate NAME_FILE entries.
3. Correctly mask NAME_FILE for .so links.
|
|
|
|
|
|
| |
they are ignored, just in the same way as for request names
and for low-level macro names.
This also cures a warning in the pod2man(1) preamble.
|
|
|
|
|
|
|
| |
for groff compatibility because pod2man(1) uses it that way.
Weirdly, groff documents it as "for compatibility with other
troff versions" but neither Heirloom nor Plan 9 have it.
Issue reported by giovanni@ via sthen@.
|
|
|
|
|
|
| |
parent directories exist, but complain about invalid directories
given on the command line.
Intended to fix an oddity reported by sthen@.
|
|
|
|
|
|
| |
first .Nm entries over other NAME .Nm entries over SYNOPSIS .Nm entries.
For example, this makes sure "man ypbind" does not return yp(8).
Re-run "makewhatis" to profit from this change.
|
|
|
|
|
|
|
|
|
|
| |
* .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@.
|
|
|
|
|
|
| |
the `vbl' variable includes the left margin, but `vis' does not.
Prevent a `vis' underflow that caused a bogus blank line.
Bug reported by Carsten Kunze, found in less(1): .Bl -tag ... .It " "
|
|
|
|
|
|
|
|
|
| |
* not supported by groff
* not used in any OpenBSD, NetBSD, DragonFly or FreeBSD base manual
* superseded or retracted
* and more than ten years old
Triggered by a question from Carsten Kunze (Heirloom troff).
OK guenther@ jmc@
|
|
|
|
|
|
|
| |
Problem found and patch provided by Martin Natano at bitrig, thanks!
Tested on macppc by natano@ and on i386, amd64, and sparc64 myself.
While here, sync with OpenBSD by removing some trailing whitespace.
|
|
|
|
|
| |
that contained at least one match in order to not prefer mdoc(1) from
ports over mdoc(7). As a bonus, this results in a speedup.
|
|
|
|
|
|
| |
Usually, -h output is short, so the pager is just a nuisance.
Also, traditional man(1) does not use a pager for -h.
Triggered by a remark of deraadt@ on ICB.
|
|
|
|
| |
requested by tedu@
|
|
|
|
|
|
| |
at the beginning of the first item of an enclosing list
right at the beginning of a new section or subsection;
minibug reported by Steffen Nurpmeso <sdaoden at yandex dot com>
|
|
|
|
| |
punctuation in the middle of .Fn
|
|
|
|
| |
this is now possible because -Tps now handles backspace overstriking.
|
|
|
|
|
|
|
| |
the same way the mdoc(7) macros marked MDOC_JOIN do it.
In -Thtml, this removes bogus <br/> when the font macros are used
in no-fill mode; issue found by jsg@ in the Xcursor(3) SYNOPSIS.
As a bonus, this slightly reduces the size of the syntax tree.
|
|
|
|
|
|
| |
and reduces the number of arguments of many functions.
While here, sprinkle some KNF.
No functional change.
|
|
|
|
|
|
| |
Some functions need multiple parse points, some none at all,
and it varies whether any of them need to be passed around.
So better pass them as a separate argument, and only when needed.
|
| |
|
|
|
|
|
|
|
|
|
| |
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@.
|
| |
|