]> git.cameronkatri.com Git - mandoc.git/log
mandoc.git
7 years agoFix previous: mmap(2) returns MAP_FAILED on failure, not NULL.
Ingo Schwarze [Sat, 26 Aug 2017 20:38:14 +0000 (20:38 +0000)]
Fix previous: mmap(2) returns MAP_FAILED on failure, not NULL.
Bug pointed out by tedu@.

7 years agoDo not fork and exec cmp(1); instead, simply fstat(2), mmap(2), and
Ingo Schwarze [Sat, 26 Aug 2017 15:55:46 +0000 (15:55 +0000)]
Do not fork and exec cmp(1); instead, simply fstat(2), mmap(2), and
compare the files directly, allowing a much stricter pledge(2), at
very little cost: merely 15 additional lines of very simple code.
Suggested by George Brown <321 dot george at gmail dot com> on misc@.

7 years agoNo need to fork and exec rm(1) -rf, we know that we have exactly
Ingo Schwarze [Sat, 26 Aug 2017 12:59:17 +0000 (12:59 +0000)]
No need to fork and exec rm(1) -rf, we know that we have exactly
one file and exactly one directory to remove.  While here, increase
the size of the buffer such that the file name actually fits.
Minus 17 lines of code, no functional change.

Opportunity for simplification reported by George Brown <321 dot
george at gmail dot com> on misc@.

7 years agoremove spacing after another representation of unary minus
Ingo Schwarze [Wed, 23 Aug 2017 21:56:20 +0000 (21:56 +0000)]
remove spacing after another representation of unary minus

7 years agoremove spacing after unary minus
Ingo Schwarze [Wed, 23 Aug 2017 20:49:15 +0000 (20:49 +0000)]
remove spacing after unary minus

7 years agoeliminate white space after opening and before closing punctuation
Ingo Schwarze [Wed, 23 Aug 2017 20:29:42 +0000 (20:29 +0000)]
eliminate white space after opening and before closing punctuation

7 years agouse the tty-char macro file for ASCII comparisons
Ingo Schwarze [Wed, 23 Aug 2017 20:03:17 +0000 (20:03 +0000)]
use the tty-char macro file for ASCII comparisons

7 years agoSuppress spacing before certain kinds of lists.
Ingo Schwarze [Wed, 23 Aug 2017 20:03:17 +0000 (20:03 +0000)]
Suppress spacing before certain kinds of lists.
One benefit is a reduced probablity that a blank appears between
a function name and the opening parenthesis introducing the arguments.
The heuristics isn't perfect and may occasionally suppress a blank
that wouldn't do harm.

7 years agoImprove ASCII rendering of a few rare character escape sequences
Ingo Schwarze [Wed, 23 Aug 2017 13:01:29 +0000 (13:01 +0000)]
Improve ASCII rendering of a few rare character escape sequences
that can be changed unilaterally because groff fails to render them
at all.

7 years agocatch up with ASCII renderings in chars.c rev. 1.72
Ingo Schwarze [Wed, 23 Aug 2017 10:59:58 +0000 (10:59 +0000)]
catch up with ASCII renderings in chars.c rev. 1.72

7 years agoSwitch ASCII rendering of the same mathematical symbols and greek
Ingo Schwarze [Wed, 23 Aug 2017 10:50:15 +0000 (10:50 +0000)]
Switch ASCII rendering of the same mathematical symbols and greek
letters as in groff commit babca15f from trying to imitate the
characters' graphical shapes, which resulted in unintelligible
renderings in many cases, to transliterations conveying the characters'
meanings.  One benefit is making these characters usable for portable
manual pages.

Solving a problem pointed out by bentley@.

7 years agoCorrect the mandoc.db(5) requirements of man(1) after the deprecation
Ingo Schwarze [Tue, 22 Aug 2017 18:17:52 +0000 (18:17 +0000)]
Correct the mandoc.db(5) requirements of man(1) after the deprecation
of MLINKS.  Inaccuracy pointed out by espie@.

7 years agoWhen finding a bogus database entry,
Ingo Schwarze [Tue, 22 Aug 2017 17:50:11 +0000 (17:50 +0000)]
When finding a bogus database entry,
print a meaningful warning and skip the entry.
Issue reported by espie@.

7 years agoWhen the stdout stream gets broken, there is no point in reading
Ingo Schwarze [Mon, 21 Aug 2017 15:42:58 +0000 (15:42 +0000)]
When the stdout stream gets broken, there is no point in reading
any more input files, and it would be misleading to start a parser,
because that would show randomly truncated text.
Instead, print an error message and exit the program.

Issue found by Leah Neukirchen <leah at vuxu dot org>, who was
surprised to see half a manpage when her /tmp/ overflew.

7 years agosync with FreeBSD;
Ingo Schwarze [Sun, 20 Aug 2017 02:30:27 +0000 (02:30 +0000)]
sync with FreeBSD;
suggested by Sevan Janiyan <venture37 at geeklan dot co dot uk>

7 years agoDelete the lie that $PAGER would only be used with -a or -l; the text
Ingo Schwarze [Sat, 19 Aug 2017 22:05:38 +0000 (22:05 +0000)]
Delete the lie that $PAGER would only be used with -a or -l; the text
was probably copied from mandoc(1) or apropos(1), where it is true.

7 years agodocument -O mdoc; triggered by a question from jmc@ and OK jmc@
Ingo Schwarze [Sat, 19 Aug 2017 22:00:05 +0000 (22:00 +0000)]
document -O mdoc; triggered by a question from jmc@ and OK jmc@

7 years agoMake the "new sentence, new line" check stricter, allowing digits
Ingo Schwarze [Fri, 11 Aug 2017 16:56:21 +0000 (16:56 +0000)]
Make the "new sentence, new line" check stricter, allowing digits
in the last two letters of the last word of the sentence.
No false positives in base or Xenocara.
Suggested by and OK jmc@.

7 years agoAdd two EXAMPLES; triggered by a question from jmc@.
Ingo Schwarze [Fri, 11 Aug 2017 15:10:26 +0000 (15:10 +0000)]
Add two EXAMPLES; triggered by a question from jmc@.
Feedback and OK jmc@.

7 years agoExplain how to transform markup for the terminal when not using a
Ingo Schwarze [Wed, 9 Aug 2017 12:49:04 +0000 (12:49 +0000)]
Explain how to transform markup for the terminal when not using a
pager, and how to remove markup.  Add related cross references.
While here, as suggested by jmc@, replace the excessive cross
references to the intro pages by a more relevant one to mandoc(1).
Triggered by a question from, using feedback from, and OK jmc@.

7 years agorelease 1.14.3 VERSION_1_14_3
Ingo Schwarze [Sat, 5 Aug 2017 13:34:39 +0000 (13:34 +0000)]
release 1.14.3

7 years agoNo longer use names that only occur in the SYNOPSIS section as names
Ingo Schwarze [Wed, 2 Aug 2017 13:29:04 +0000 (13:29 +0000)]
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@

7 years agoIgnore explicitly specified negative column widths rather than
Ingo Schwarze [Mon, 31 Jul 2017 16:14:10 +0000 (16:14 +0000)]
Ignore explicitly specified negative column widths rather than
wrapping around to huge numbers and risking memory exhaustion;
fixes Debian ps(1).  Bug reported by Dr. Markus Waldeck.

7 years agoFix an out of bounds read access to a constant array that caused
Ingo Schwarze [Mon, 31 Jul 2017 15:19:06 +0000 (15:19 +0000)]
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.

7 years agofinal tweaks for the 1.14.2 release VERSION_1_14_2
Ingo Schwarze [Fri, 28 Jul 2017 14:57:56 +0000 (14:57 +0000)]
final tweaks for the 1.14.2 release

7 years agoWhen the mparse_alloc() prototype changed in read.c 1.179, updating
Ingo Schwarze [Fri, 28 Jul 2017 14:48:25 +0000 (14:48 +0000)]
When the mparse_alloc() prototype changed in read.c 1.179, updating
the enum constant was forgotten in this call.  No functional change
since the mmsg argument is NULL anyway.
Found by florian@ with clang.

7 years agofix typo in TERMP_MULTICOL flag test;
Ingo Schwarze [Fri, 28 Jul 2017 14:25:48 +0000 (14:25 +0000)]
fix typo in TERMP_MULTICOL flag test;
patch from florian@, found with clang

7 years agodisable .Xr -Tlint test for now,
Ingo Schwarze [Fri, 28 Jul 2017 13:02:25 +0000 (13:02 +0000)]
disable .Xr -Tlint test for now,
it causes too much trouble on non-OpenBSD systems

7 years agoDo not test .Xr here. It is not what this directory should focus on,
Ingo Schwarze [Fri, 28 Jul 2017 12:48:04 +0000 (12:48 +0000)]
Do not test .Xr here.  It is not what this directory should focus on,
and it is causing too much trouble in -portable.

7 years agoFix a typo that caused a non-constant string
Ingo Schwarze [Wed, 26 Jul 2017 10:33:34 +0000 (10:33 +0000)]
Fix a typo that caused a non-constant string
to be passed as a format string; no functional change;
reported by Michael <Stapelberg at debian>.

7 years agoCast the return value of chdir(2) to void. We already have a comment
Ingo Schwarze [Wed, 26 Jul 2017 10:21:55 +0000 (10:21 +0000)]
Cast the return value of chdir(2) to void.  We already have a comment
above explaining to human auditors why no error checking is needed
here, so it's only fair to tell the compiler, too.
Worried compiler reported by Michael <Stapelberg at debian>.

7 years agotwo more entries from the mdoclint TODO, clerified by wiz@
Ingo Schwarze [Mon, 24 Jul 2017 11:15:12 +0000 (11:15 +0000)]
two more entries from the mdoclint TODO, clerified by wiz@

7 years agomigrate the mdoclint(1) TODO list here, from pkgsrc
Ingo Schwarze [Sat, 22 Jul 2017 20:43:40 +0000 (20:43 +0000)]
migrate the mdoclint(1) TODO list here, from pkgsrc

7 years agoAvoid cross reference to mandoc(1) because it may cause a message
Ingo Schwarze [Thu, 20 Jul 2017 16:35:38 +0000 (16:35 +0000)]
Avoid cross reference to mandoc(1) because it may cause a message
on other operating systems where mandoc is not installed,
causing the test to fail in the portable test suite.

7 years agomore renaming from mdocml to mandoc
Ingo Schwarze [Thu, 20 Jul 2017 16:24:53 +0000 (16:24 +0000)]
more renaming from mdocml to mandoc

7 years agomention -Tlint to stdout
Ingo Schwarze [Thu, 20 Jul 2017 16:23:56 +0000 (16:23 +0000)]
mention -Tlint to stdout

7 years agoMAP_PRIVATE is pointless without PROT_WRITE
Ingo Schwarze [Thu, 20 Jul 2017 15:41:26 +0000 (15:41 +0000)]
MAP_PRIVATE is pointless without PROT_WRITE

7 years agoFor -Tlint, put parser messages on stdout instead of stderr.
Ingo Schwarze [Thu, 20 Jul 2017 15:26:41 +0000 (15:26 +0000)]
For -Tlint, put parser messages on stdout instead of stderr.

Originally, naddy@ requested this in 2011 (or maybe even earlier).
It was discussed with joerg@, kristaps@, naddy@, and espie@ in 2011,
and everybody agreed in principle, but it was postponed because
kristaps@ wanted to do some cleanup of the message system first.
Meanwhile, message infrastructure was improved about a dozen times...

This makes long, tedious commands like "mandoc -Tlint *.1 2>&1 | less"
unnecessary and allows simple ones like "man -l -Tlint *.1".

7 years agoDo not call err(3) from the parser. Call mandoc_vmsg() and
Ingo Schwarze [Thu, 20 Jul 2017 14:36:36 +0000 (14:36 +0000)]
Do not call err(3) from the parser.  Call mandoc_vmsg() and
return failure such that we can continue with the next file.

7 years agocorrectly handle letters in .Nx arguments; improves for example
Ingo Schwarze [Thu, 20 Jul 2017 12:54:02 +0000 (12:54 +0000)]
correctly handle letters in .Nx arguments; improves for example
getpgid(2), ac(8), ldconfig(8), mount_ffs(8), sa(8), ttyflags(8), ...

7 years agothree ideas found in a different TODO file
Ingo Schwarze [Thu, 20 Jul 2017 11:58:31 +0000 (11:58 +0000)]
three ideas found in a different TODO file

7 years ago* clean catman.o which was missing
Ingo Schwarze [Thu, 20 Jul 2017 11:41:54 +0000 (11:41 +0000)]
* clean catman.o which was missing
* delete WWW_OBJS which i don't use
* do not complain about *.out_markdown
* bump VERSION to 1.14.2 (not released yet)

7 years agosync
Ingo Schwarze [Thu, 20 Jul 2017 11:24:19 +0000 (11:24 +0000)]
sync

7 years agoFix incorrectly swapped labels of left/right arrows; from bentley@.
Ingo Schwarze [Thu, 20 Jul 2017 11:07:27 +0000 (11:07 +0000)]
Fix incorrectly swapped labels of left/right arrows; from bentley@.

7 years agodelete some entries that have been taken care of
Ingo Schwarze [Wed, 19 Jul 2017 21:48:37 +0000 (21:48 +0000)]
delete some entries that have been taken care of

7 years agomore bits for 1.14.2
Ingo Schwarze [Wed, 19 Jul 2017 21:01:59 +0000 (21:01 +0000)]
more bits for 1.14.2

7 years agoPrefer arch-dependent over arch-independent pages if the name priority,
Ingo Schwarze [Wed, 19 Jul 2017 14:05:13 +0000 (14:05 +0000)]
Prefer arch-dependent over arch-independent pages if the name priority,
the section number, and all names match.  Changes little on installed
systems except the ordering of apropos(1) results, because we install
base and Xenocara manuals in different trees, but fixes lookup of pages
like apm(4) vs. apm(4/amd64) in man.cgi(8).
Issue discovered by martian67 on freenode and reported via tj@.

7 years agoRun the regression tests iteratively rather than recursively.
Ingo Schwarze [Tue, 18 Jul 2017 18:47:06 +0000 (18:47 +0000)]
Run the regression tests iteratively rather than recursively.
Simpler user interface, better summary output, simpler code,
and slightly faster.
Inspired by espie@'s request to avoid needless recursive make(1)
in the OpenBSD regression testing tree.

7 years agoThe only elements using floats are dt.It-tag,
Ingo Schwarze [Sun, 16 Jul 2017 18:45:00 +0000 (18:45 +0000)]
The only elements using floats are dt.It-tag,
so the only elements allowed to the right of them are dd.It-tag.
Fixes overlapping rendering after long tag lists without bodies,
for example in the Xenocara apm(4) manual.  Issue reported by tj@.

7 years agotest -diag -width and -inset -width
Ingo Schwarze [Sun, 16 Jul 2017 17:59:43 +0000 (17:59 +0000)]
test -diag -width and -inset -width

7 years agoIn .Bl -tag and -hang, do not print a margin-left style attribute
Ingo Schwarze [Sat, 15 Jul 2017 17:57:51 +0000 (17:57 +0000)]
In .Bl -tag and -hang, do not print a margin-left style attribute
for each individual item if the -width argument matches the default
of 6n.  Suggested by Steffen Nurpmeso <steffen at sdaoden dot eu>
on <groff at GNU dot org> in April 2017.

7 years agouse the same width increase logic for .Bl -hang as for .Bl -tag
Ingo Schwarze [Sat, 15 Jul 2017 17:29:31 +0000 (17:29 +0000)]
use the same width increase logic for .Bl -hang as for .Bl -tag

7 years agoIf -column, -diag, -inset, -item, or -ohang lists have a -width,
Ingo Schwarze [Sat, 15 Jul 2017 16:40:29 +0000 (16:40 +0000)]
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.

7 years agocorrect left margins for different classes of definition lists
Ingo Schwarze [Sat, 15 Jul 2017 16:35:52 +0000 (16:35 +0000)]
correct left margins for different classes of definition lists

7 years agoprint the right character for mathematical overbar; from bentley@
Ingo Schwarze [Sat, 15 Jul 2017 16:26:17 +0000 (16:26 +0000)]
print the right character for mathematical overbar; from bentley@

7 years agoImprove rev. 1.250 further:
Ingo Schwarze [Sat, 15 Jul 2017 13:17:49 +0000 (13:17 +0000)]
Improve rev. 1.250 further:
If a database is empty, we already don't write a database file and
delete an existing one.  If none exists, that only means the database
was empty and remains so, which is not an error.  So don't nag about
it, in particular because that would be a weekly(8) annoyance.
Issue reported by jmc@.

7 years agofirst draft of the 1.14.2 release notes
Ingo Schwarze [Sat, 15 Jul 2017 01:11:19 +0000 (01:11 +0000)]
first draft of the 1.14.2 release notes

7 years agoalways give commas their own <mo> element,
Ingo Schwarze [Fri, 14 Jul 2017 18:18:26 +0000 (18:18 +0000)]
always give commas their own <mo> element,
suggested by bentley@, improves e.g. glMultMatrix(3)

7 years agoThe .Dd and .TH macros must interrupt .ce, too;
Ingo Schwarze [Fri, 14 Jul 2017 17:16:16 +0000 (17:16 +0000)]
The .Dd and .TH macros must interrupt .ce, too;
fixing tree corruption and assertion failure found by jsg@ with afl(1)

7 years agoExplicitly initialize a variable where the compiler is (understandably)
Ingo Schwarze [Fri, 14 Jul 2017 16:49:39 +0000 (16:49 +0000)]
Explicitly initialize a variable where the compiler is (understandably)
unable to figure out that it is never used uninitialized.
While here, tweak the content of the variable to make its usage
easier to understand.  No functional change.

7 years agoFix an assertion failure triggered by print_otag("sw+-l", NULL).
Ingo Schwarze [Fri, 14 Jul 2017 16:28:38 +0000 (16:28 +0000)]
Fix an assertion failure triggered by print_otag("sw+-l", NULL).
Even though we skip the style when the argument is NULL,
we must still consume the options.
Not found with afl(1), but during manual testing of the previous patch...

7 years agoHandle .Bl -compact via CSS rather than writing individual style
Ingo Schwarze [Fri, 14 Jul 2017 16:06:44 +0000 (16:06 +0000)]
Handle .Bl -compact via CSS rather than writing individual style
attributes into .It blocks; suggested by Steffen Nurpmeso <steffen
at sdaoden dot eu> on <groff at GNU dot org> in April 2017.

Delete margin-bottom and margin-top style names and the 'v' argument
letter from print_otag() because they are no longer used.

7 years agoprint HTML character references as 4+ digits hexadecimal, like Unicode;
Ingo Schwarze [Fri, 14 Jul 2017 15:56:37 +0000 (15:56 +0000)]
print HTML character references as 4+ digits hexadecimal, like Unicode;
from bentley@, tweaked by me

7 years agodo not print <math class="eqn"><mrow></mrow></math> for empty .EQ;
Ingo Schwarze [Fri, 14 Jul 2017 13:32:35 +0000 (13:32 +0000)]
do not print <math class="eqn"><mrow></mrow></math> for empty .EQ;
issue reported by bentley@

7 years agoeqn(7) nits from bentley@
Ingo Schwarze [Fri, 14 Jul 2017 12:48:37 +0000 (12:48 +0000)]
eqn(7) nits from bentley@

7 years agoeqn(7) .EQ has to break man(7) next-line scope, or tree corruption
Ingo Schwarze [Thu, 13 Jul 2017 15:13:18 +0000 (15:13 +0000)]
eqn(7) .EQ has to break man(7) next-line scope, or tree corruption
and use after free many ensue; again found by jsg@ with afl(1)

7 years agoSimplify by creating struct roff_node syntax tree nodes for tbl(7)
Ingo Schwarze [Sat, 8 Jul 2017 17:52:49 +0000 (17:52 +0000)]
Simplify by creating struct roff_node syntax tree nodes for tbl(7)
right from roff_parseln() rather than delegating to read.c,
similar to what i just did for eqn(7).

The interface function roff_span() becomes obsolete and is deleted,
the former interface function roff_addtbl() becomes static,
the interface functions tbl_read() and tbl_cdata() become void,
and minus twelve linus of code.

No functional change.

7 years agofix an assertion failure triggered by .ce in next-line scope;
Ingo Schwarze [Sat, 8 Jul 2017 15:28:09 +0000 (15:28 +0000)]
fix an assertion failure triggered by .ce in next-line scope;
found by jsg@ with afl(1)

7 years ago1. Eliminate struct eqn, instead use the existing members
Ingo Schwarze [Sat, 8 Jul 2017 14:51:04 +0000 (14:51 +0000)]
1. Eliminate struct eqn, instead use the existing members
of struct roff_node which is allocated for each equation anyway.
2. Do not keep a list of equation parsers, one parser is enough.
Minus fifty lines of code, no functional change.

7 years agoCorrectly handle horizontal spans at the beginning of rows,
Ingo Schwarze [Sat, 8 Jul 2017 13:43:15 +0000 (13:43 +0000)]
Correctly handle horizontal spans at the beginning of rows,
fixing an assertion failure found by jsg@ with afl(1).

While here, also drop printing of whitespace in tbl_data()
which makes no difference because column positioning code
in term_tbl() already takes care of that.

7 years agogarbage collect unused enum member EQN_ROOT
Ingo Schwarze [Fri, 7 Jul 2017 19:39:30 +0000 (19:39 +0000)]
garbage collect unused enum member EQN_ROOT

7 years agoadd parentheses to the output where required for disambiguation
Ingo Schwarze [Fri, 7 Jul 2017 19:06:31 +0000 (19:06 +0000)]
add parentheses to the output where required for disambiguation

7 years agosimplify the eqn_box_makebinary() function by removing the trivial pos
Ingo Schwarze [Fri, 7 Jul 2017 17:16:17 +0000 (17:16 +0000)]
simplify the eqn_box_makebinary() function by removing the trivial pos
parameter; also minus two lines of code; no functional change

7 years agoRadically simplify the definitions what the message levels ERROR
Ingo Schwarze [Fri, 7 Jul 2017 16:20:30 +0000 (16:20 +0000)]
Radically simplify the definitions what the message levels ERROR
and WARNING mean: minus 20 lines of mdoc source.  OK jmc@.

7 years agoNow that we have the -Wstyle message level, downgrade six warnings
Ingo Schwarze [Thu, 6 Jul 2017 22:59:48 +0000 (22:59 +0000)]
Now that we have the -Wstyle message level, downgrade six warnings
that are not syntax mistakes and that do not cause wrong formatting
or content to style suggestions.
Also upgrade two warnings that may cause information loss to errors.

7 years agoFix operator precedence according to Brian W. Kernighan and Lorinda
Ingo Schwarze [Thu, 6 Jul 2017 00:19:54 +0000 (00:19 +0000)]
Fix operator precedence according to Brian W. Kernighan and Lorinda
L. Cherry, "Typesetting Mathematics - User's Guide (Second Edition)",
August 15, 1978, paragraph 23; swarm of bugs pointed out by bentley@.

7 years agoThe EQN_LISTONE box type is pointless.
Ingo Schwarze [Wed, 5 Jul 2017 15:03:27 +0000 (15:03 +0000)]
The EQN_LISTONE box type is pointless.
Simplify by just using EQN_LIST with expectargs = 1.
Noticed while investigating a bug report from bentley@.
No functional change.

7 years agonits about trailing punctuation found with mandoc -Tlint
Ingo Schwarze [Wed, 5 Jul 2017 12:25:17 +0000 (12:25 +0000)]
nits about trailing punctuation found with mandoc -Tlint

7 years agovarious nits found with mandoc -Tlint
Ingo Schwarze [Tue, 4 Jul 2017 23:40:01 +0000 (23:40 +0000)]
various nits found with mandoc -Tlint

7 years agoFix handling of \} on roff request lines.
Ingo Schwarze [Tue, 4 Jul 2017 22:52:00 +0000 (22:52 +0000)]
Fix handling of \} on roff request lines.
Cures bogus error messages in pages generated with pod2man(1).

7 years agoIt turns out association of tbl spans with layout rows is simpler than
Ingo Schwarze [Tue, 4 Jul 2017 21:08:29 +0000 (21:08 +0000)]
It turns out association of tbl spans with layout rows is simpler than
i thought.  Fixing a bug in curs_addch(3) and minus 25 lines of code.

7 years agoadjust to today's change of the OpenBSD groff port
Ingo Schwarze [Tue, 4 Jul 2017 21:01:17 +0000 (21:01 +0000)]
adjust to today's change of the OpenBSD groff port

7 years agoMessages of the -Wbase level now print STYLE:. Since this
Ingo Schwarze [Tue, 4 Jul 2017 15:24:36 +0000 (15:24 +0000)]
Messages of the -Wbase level now print STYLE:.  Since this
causes horrible churn anyway, profit of the opportunity to stop
excessive testing, such that this is hopefully the last instance
of such churn.  Consistently use OpenBSD RCS tags, blank .Os,
blank fourth .TH argument, and Mdocdate like everywhere else.
Use -Ios=OpenBSD for platform-independent predictable output.

7 years agoPrinting "BASE:" in messages about violations of base system conventions
Ingo Schwarze [Tue, 4 Jul 2017 14:40:38 +0000 (14:40 +0000)]
Printing "BASE:" in messages about violations of base system conventions
is confusing, simply print "STYLE:", which is intuitive and does not
sound excessively alarming; suggested by jmc@, OK tedu@ jmc@.

7 years agoreport trailing delimiters after macros where they are usually a mistake;
Ingo Schwarze [Mon, 3 Jul 2017 17:33:05 +0000 (17:33 +0000)]
report trailing delimiters after macros where they are usually a mistake;
the idea came up in a discussion with Thomas Klausner <wiz at NetBSD>

7 years agowarn about time machines; suggested by Thomas Klausner <wiz @ NetBSD>
Ingo Schwarze [Mon, 3 Jul 2017 13:40:18 +0000 (13:40 +0000)]
warn about time machines; suggested by Thomas Klausner <wiz @ NetBSD>

7 years agoIf a single page references the same non-existent manual more than
Ingo Schwarze [Sun, 2 Jul 2017 21:18:29 +0000 (21:18 +0000)]
If a single page references the same non-existent manual more than
once, print "(N times)" after the message "referenced manual not
found", to lessen the risk that people fix the first instance and
miss the others; jmc@ confirmed that this is useful.

7 years agoadd warning "cross reference to self"; inspired by mdoclint
Ingo Schwarze [Sun, 2 Jul 2017 15:31:59 +0000 (15:31 +0000)]
add warning "cross reference to self"; inspired by mdoclint

7 years agoWhen checking cross references with -Tlint, ultimately fall back to
Ingo Schwarze [Sat, 1 Jul 2017 12:54:07 +0000 (12:54 +0000)]
When checking cross references with -Tlint, ultimately fall back to
looking in the current working directory.  Not a security issue
because the files are never open(2)ed, only access(2)ed.
Requested by jmc@ and inspired by mdoclint(1).

This cannot be perfect because it only works for files having the
exact filename ./pagename.sec - mandoc has no way to figure out
which files might contain a manual for multiple names, or that files
in autohell might be called ./pagename.man.in instead, or which
subdirectories might contain additional source files.  Also, it may
hide messages if you have bogus stuff lying around in the directory
where you run mandoc -Tlint.  But jmc@ considers it important, and
good enough for everyday use.

Also avoid leaking the memory for the file name while here.

7 years agoWhen checking the validity of cross references with -Tlint,
Ingo Schwarze [Sat, 1 Jul 2017 12:02:31 +0000 (12:02 +0000)]
When checking the validity of cross references with -Tlint,
fall back from database search to file system search
just like man(1) does when looking up manuals.

This is not too expensive because on a system having up-to-date
mandoc.db(5) files, it only prolongs the time needed to check
*invalid* references - and you are not supposed to have many of
those, right?  And on a system with missing or invalid mandoc.db(5)
files, spending a bit of time and warning loudly about the real
problem is also better than quickly issuing bogus warnings about
cross references that are actually valid.

7 years agoBasic reporting of .Xrs to manual pages that don't exist
Ingo Schwarze [Sat, 1 Jul 2017 09:47:30 +0000 (09:47 +0000)]
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.

7 years agoSkip whitespace at the beginning of eqn(7) nodes,
Ingo Schwarze [Thu, 29 Jun 2017 16:31:15 +0000 (16:31 +0000)]
Skip whitespace at the beginning of eqn(7) nodes,
in particular ~ and ^ that misrendered;
found by bentley@ in glCopyTexSubImage1D(3); also affected
glAccum(3), glClipPlane(3), glDrawPixels(3), glEvalMesh(3), and others.

7 years agowarn about some non-portable idioms in .Bl -column;
Ingo Schwarze [Thu, 29 Jun 2017 15:22:17 +0000 (15:22 +0000)]
warn about some non-portable idioms in .Bl -column;
triggered by a question from Yuri Pankov (illumos)

7 years agoClarify that .Ta as a line macro is a portability problem,
Ingo Schwarze [Thu, 29 Jun 2017 13:17:00 +0000 (13:17 +0000)]
Clarify that .Ta as a line macro is a portability problem,
even though mandoc(1) handles it;
triggered by a question from Yuri Pankov (illumos).

7 years agofix incomplete handling of roff(7) nodes in man(7) block next-line scope;
Ingo Schwarze [Wed, 28 Jun 2017 12:52:45 +0000 (12:52 +0000)]
fix incomplete handling of roff(7) nodes in man(7) block next-line scope;
assertion failure in tclsh(1) reported by deraadt@ via bentley@

7 years agoRewrite half of this, i was completely unaware how bad it was.
Ingo Schwarze [Wed, 28 Jun 2017 00:59:57 +0000 (00:59 +0000)]
Rewrite half of this, i was completely unaware how bad it was.
Remove several lies, lots of duplicate information,
and a lengthy discussion of features we don't support.
Clarify the wording in some places and make it more concise in others.
Delete examples from where they don't belong
and write a new EXAMPLES section from scratch.

7 years agotest inter-column spacing
Ingo Schwarze [Tue, 27 Jun 2017 19:51:48 +0000 (19:51 +0000)]
test inter-column spacing

7 years agoImplement spacing of columns as defined in the table layout;
Ingo Schwarze [Tue, 27 Jun 2017 18:25:02 +0000 (18:25 +0000)]
Implement spacing of columns as defined in the table layout;
this is for example used by lftp(1)
and, ironically, misused by our very own tbl(7) manual...

7 years agowarn about .Ns macros that have no effect because they are followed
Ingo Schwarze [Tue, 27 Jun 2017 12:18:00 +0000 (12:18 +0000)]
warn about .Ns macros that have no effect because they are followed
by an isolated closing delimiter; inspired by mdoclint

7 years agocatch up with the recent eqn(7) improvements
Ingo Schwarze [Mon, 26 Jun 2017 20:11:45 +0000 (20:11 +0000)]
catch up with the recent eqn(7) improvements