]> git.cameronkatri.com Git - mandoc.git/log
mandoc.git
6 years agoAdd strndup(3) compat implementation.
Ingo Schwarze [Tue, 27 Feb 2018 11:16:23 +0000 (11:16 +0000)]
Add strndup(3) compat implementation.
Jan Stary reports that MacOS X Snow Leopard and older lacks it.

6 years agoAfter opening a file with gzdopen(3), we have to call gzclose(3) or
Ingo Schwarze [Fri, 23 Feb 2018 21:35:19 +0000 (21:35 +0000)]
After opening a file with gzdopen(3), we have to call gzclose(3) or
we leak memory internally used by zlib to keep compression state.
Bug reported by Wolfgang Mueller <vehk at vehk dot de> who also
provided an incomplete patch, part of which i'm using in this commit.

6 years agoclarify documentation of macro keys
Ingo Schwarze [Fri, 23 Feb 2018 18:54:02 +0000 (18:54 +0000)]
clarify documentation of macro keys

6 years agoLogically, the following are are type names - just like .Vt,
Ingo Schwarze [Fri, 23 Feb 2018 18:25:57 +0000 (18:25 +0000)]
Logically, the following are are type names - just like .Vt,
some of them with an optional variable name following:
- .Ft
- .Fa in the SYNOPSIS
- .Fn second and later arguments in the SYNOPSIS
So add these to the .Vt macro table in the mandoc.db(5) database.
During my LibreSSL work, i'm getting really tired of typing
$ man -k Vt,Ft,Fa=some_type_name
over and over again; now, this becomes just:
$ man -k Vt=some_type_name

6 years agoInvalidate the tag_files.tfd after fclose(3)ing the stram associated
Ingo Schwarze [Fri, 23 Feb 2018 16:47:10 +0000 (16:47 +0000)]
Invalidate the tag_files.tfd after fclose(3)ing the stram associated
with it.  In main() assert that the tfd was actually invalidated.
This avoids closing an invalid fd.
From tb@; OK deraadt@ on an earlier version.

6 years agoIn man(7) and cat pages, cut off excessive one line descriptions.
Ingo Schwarze [Wed, 7 Feb 2018 20:31:39 +0000 (20:31 +0000)]
In man(7) and cat pages, cut off excessive one line descriptions.
An extreme example of how rogue files could mess up apropos(1) output
was reported by bentley@: qwtlicense(3) in the x11/qwt port.

6 years agoFix the mandoc_strndup() utility function. All existing callers seem
Ingo Schwarze [Wed, 7 Feb 2018 20:04:57 +0000 (20:04 +0000)]
Fix the mandoc_strndup() utility function.  All existing callers seem
safe so far, but implementing it with an unchecked memcpy(3) is just
wrong and quite dangerous.

6 years agofix wrong date
Ingo Schwarze [Wed, 7 Feb 2018 19:58:42 +0000 (19:58 +0000)]
fix wrong date

6 years agoDelete the "no blank before trailing delimiter" check from the
Ingo Schwarze [Tue, 6 Feb 2018 16:29:57 +0000 (16:29 +0000)]
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.

7 years agoRemove the implicit display feature of .Lk because it was inconsistent
Ingo Schwarze [Sat, 13 Jan 2018 05:23:18 +0000 (05:23 +0000)]
Remove the implicit display feature of .Lk because it was inconsistent
across output devices, counter-intuitive, and resulted in ugly
output for many real-world manual pages.  Always format even long
links in-line.  I already committed a similar change to groff.

OK jmc@, bentley@, and the original author
of the feature, Werner Lemberg <wl@gnu.org>.

7 years agotypo; from Alexander Kuleshov <kuleshovmail at gmail dot com>
Ingo Schwarze [Fri, 15 Dec 2017 23:39:07 +0000 (23:39 +0000)]
typo; from Alexander Kuleshov <kuleshovmail at gmail dot com>

7 years agoRecognize .Bl -column at parse time, and not only at validation time,
Ingo Schwarze [Wed, 29 Nov 2017 20:05:33 +0000 (20:05 +0000)]
Recognize .Bl -column at parse time, and not only at validation time,
even if other arguments precede -column.  This is required because
the .It parser needs to know whether or not we are a -column list.
Fixes tree corruption leading to an assertion failure.
Bug reported by bentley@.

7 years agoduplicate word, found by igor(1)
Ingo Schwarze [Tue, 28 Nov 2017 20:26:21 +0000 (20:26 +0000)]
duplicate word, found by igor(1)

7 years agostreamline termp allocation: this will allow the init function
Ingo Schwarze [Fri, 10 Nov 2017 23:42:52 +0000 (23:42 +0000)]
streamline termp allocation: this will allow the init function
to do things differently in the ps vs pdf case;
from espie@

7 years agobe less assertive when warning about a possible typo;
Ingo Schwarze [Fri, 10 Nov 2017 23:32:40 +0000 (23:32 +0000)]
be less assertive when warning about a possible typo;
from jca@, ok jmc@

7 years agoShrink -Tps output by more than 50%
Ingo Schwarze [Thu, 2 Nov 2017 14:53:02 +0000 (14:53 +0000)]
Shrink -Tps output by more than 50%
by using PostScript as a programming language.
* Define and use one PostScript procedure to select each font.
* Define and use procedures combining "use" and "show".
* In one of these, reuse the current row if it did not change.
Most ideas and most coding by espie@, tweaked by me.

7 years agoPrint a human-readable media name in the %%DocumentMedia DSC comment
Ingo Schwarze [Sun, 29 Oct 2017 19:25:31 +0000 (19:25 +0000)]
Print a human-readable media name in the %%DocumentMedia DSC comment
and use the setpagedevice PostScript operator to help printers
automatically select the paper of the best matching PageSize.

Many thanks to Mike Williams <obsd1 at eandem dot co dot uk>
for teaching me about the relevant features of PostScript and DSC
and for suggesting what to put into the first %%DocumentMedia argument.

7 years agoduplicate anchors
Ingo Schwarze [Sat, 28 Oct 2017 16:20:24 +0000 (16:20 +0000)]
duplicate anchors

7 years agomore readable conversion of paper size from millimeters to PostScript
Ingo Schwarze [Thu, 26 Oct 2017 18:11:31 +0000 (18:11 +0000)]
more readable conversion of paper size from millimeters to PostScript
basic units, also slightly more precise

7 years agoThe page footer line (psmarg) is created in ps_begin(), and the
Ingo Schwarze [Wed, 25 Oct 2017 20:48:48 +0000 (20:48 +0000)]
The page footer line (psmarg) is created in ps_begin(), and the
last call writing to it is always ps_endline(), which ends with
ps_pclose(), which prints "ET" (end text).

Consequently, do not print another instance of "ET" in ps_closepage()
after the footer line and before the "endstream" for the page.

Fixing a PDF syntax error found while investigating the bug report
from Jan Stary that also resulted in the previous commit.

7 years agoProperly close out the top-level Font object, the end-of-page
Ingo Schwarze [Wed, 25 Oct 2017 18:52:06 +0000 (18:52 +0000)]
Properly close out the top-level Font object, the end-of-page
Resource objects, and the Catalog object, fixing three PDF syntax
errors that were present in every PDF file generated with mandoc
since the initial checkin of the formatter in July 2010.
Bug reported by Jan Stary <hans at stare dot cz> on misc@.

7 years agoModernize documentation of .Ao and .Aq.
Ingo Schwarze [Mon, 23 Oct 2017 13:54:41 +0000 (13:54 +0000)]
Modernize documentation of .Ao and .Aq.

I looked through our whole tree and failed to find a single use
that is really convincing, except those with .Mt.  Putting it around
character and key names is somewhat widespread and maybe acceptable,
even if hardly useful.

So for now, delete the bogus examples and explain what these macros
are really used for.  Discourage the most common abuses.

Triggered by a question from Raf Czlonka <rczlonka at gmail dot com>.

7 years agoHISTORY: mention first appearance in OpenBSD
Ingo Schwarze [Tue, 17 Oct 2017 23:19:12 +0000 (23:19 +0000)]
HISTORY: mention first appearance in OpenBSD

7 years agoDo not segfault when there are two .Dt macros, the first without
Ingo Schwarze [Tue, 12 Sep 2017 18:21:03 +0000 (18:21 +0000)]
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).

7 years agotypo: convertion -> convention; from dcoppa@
Ingo Schwarze [Thu, 7 Sep 2017 14:55:12 +0000 (14:55 +0000)]
typo: convertion -> convention; from dcoppa@

7 years agofix a NULL pointer access on deroff() failure;
Ingo Schwarze [Wed, 6 Sep 2017 16:24:25 +0000 (16:24 +0000)]
fix a NULL pointer access on deroff() failure;
could be triggered with '.SS ""';
reported by Michael <Stapelberg at debian>

7 years agofix grammar; while here, improve spacing; from sobrado@
Ingo Schwarze [Mon, 4 Sep 2017 10:35:27 +0000 (10:35 +0000)]
fix grammar; while here, improve spacing; from sobrado@

7 years agoformat ".IP *" etc. as <ul> rather than <dl>
Ingo Schwarze [Sat, 2 Sep 2017 11:55:11 +0000 (11:55 +0000)]
format ".IP *" etc. as <ul> rather than <dl>

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