]> git.cameronkatri.com Git - mandoc.git/log
mandoc.git
7 years agowarn about missing one-line description;
Ingo Schwarze [Fri, 27 Jan 2017 11:33:26 +0000 (11:33 +0000)]
warn about missing one-line description;
missing feature found in the TODO file

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

7 years agoStandardize class attributes for semantic macros.
Ingo Schwarze [Fri, 20 Jan 2017 23:51:00 +0000 (23:51 +0000)]
Standardize class attributes for semantic macros.
Correct markup for .Va and iprove markup for .Dv, .Er, .Ev while here.

7 years agostandardize .Rs class attributes
Ingo Schwarze [Fri, 20 Jan 2017 21:37:56 +0000 (21:37 +0000)]
standardize .Rs class attributes

7 years agostandardize .Bl and .It class attributes
Ingo Schwarze [Fri, 20 Jan 2017 19:58:07 +0000 (19:58 +0000)]
standardize .Bl and .It class attributes

7 years agoclean up markup of .Bd, .D1, .Dl, .Li, and .Ql;
Ingo Schwarze [Thu, 19 Jan 2017 16:56:54 +0000 (16:56 +0000)]
clean up markup of .Bd, .D1, .Dl, .Li, and .Ql;
in particular, stop abuse of <blockquote>

7 years agoclean up .Sx and .Xr HTML markup
Ingo Schwarze [Thu, 19 Jan 2017 15:48:39 +0000 (15:48 +0000)]
clean up .Sx and .Xr HTML markup

7 years agoClean up CSS rules for sections and paragraphs.
Ingo Schwarze [Thu, 19 Jan 2017 15:27:34 +0000 (15:27 +0000)]
Clean up CSS rules for sections and paragraphs.
Start using real macro names for CSS classes.

7 years agoClean up and fix rules for header and footer lines.
Ingo Schwarze [Thu, 19 Jan 2017 14:29:53 +0000 (14:29 +0000)]
Clean up and fix rules for header and footer lines.
In particular, horizontal alignment was missing.

7 years agoAdjust indentation of the HTML output to the conventions established
Ingo Schwarze [Thu, 19 Jan 2017 13:55:56 +0000 (13:55 +0000)]
Adjust indentation of the HTML output to the conventions established
by html.c.  No semantic change.

7 years agoStart cleanup: trim useless HTML comments, <div> elements,
Ingo Schwarze [Thu, 19 Jan 2017 13:35:02 +0000 (13:35 +0000)]
Start cleanup: trim useless HTML comments, <div> elements,
and CSS rules on the <html> and <body> levels.

7 years agoImplement line breaking of the generated HTML code at space characters
Ingo Schwarze [Thu, 19 Jan 2017 01:00:14 +0000 (01:00 +0000)]
Implement line breaking of the generated HTML code at space characters
in filled text.  This does not affect HTML semantics, but makes the
HTML code even more humanly readable.

While here,
- collapse multiple consecutive space characters in filled text
- and insert a blank between style entries.

7 years agoMake HTML output more human readable by overhauling line break logic
Ingo Schwarze [Wed, 18 Jan 2017 19:22:21 +0000 (19:22 +0000)]
Make HTML output more human readable by overhauling line break logic
around tags and by introducing some simple indentation.
No change of HTML semantics intended.

8 years agoCompletely delete the buf field of struct html and all the buf*()
Ingo Schwarze [Tue, 17 Jan 2017 15:32:43 +0000 (15:32 +0000)]
Completely delete the buf field of struct html and all the buf*()
interfaces.  Such a static buffer was a bad idea in the first place,
causing unfixable truncation that was only prevented by triggering
an assertion failure.  Instead, let the small number of remaining
users allocate and free their own, temporary dynamic buffers,
or for the case of .Xr and .In, pass the original data to be
assembled in print_otag().

8 years agoSimplify the usage of print_otag() by making it accept a variable
Ingo Schwarze [Tue, 17 Jan 2017 01:47:51 +0000 (01:47 +0000)]
Simplify the usage of print_otag() by making it accept a variable
number of arguments.

Delete struct htmlpair and all the PAIR_*() macros.
Delete enum htmlattr, handle that in print_otag() instead.

Minus 190 lines of code; no functional change except better ordering
of attributes (class before style) in three cases.

8 years agoWhen looking up macro values while the macro tables are being built
Ingo Schwarze [Sun, 15 Jan 2017 15:28:55 +0000 (15:28 +0000)]
When looking up macro values while the macro tables are being built
in makewhatis(8), use ohash rather than linear searches.

This was identified as the main makewhatis(8) performance bottleneck
by Baptiste Daroussin <bapt at FreeBSD>, who also suggested part
of the improved algorithm.

This reduces the run time of "makewhatis /usr/share/man" from eleven
to five seconds on my notebook.  Note that the changed code is not
used in apropos(1), so don't expect speedups there.

While here, sort macro values asciibetically, to improve reproducibility -
which still isn't perfect, but getting better.

8 years agoSkipping all escape sequences at the beginning of strings in deroff()
Ingo Schwarze [Thu, 12 Jan 2017 18:02:20 +0000 (18:02 +0000)]
Skipping all escape sequences at the beginning of strings in deroff()
was too aggressive.  There are strings that legitimately begin with
an escape sequence.  Only skip leading escape sequences representing
whitespace.

Bug reported by martijn@.

8 years agoshow meta data for -Ttree output
Ingo Schwarze [Thu, 12 Jan 2017 17:29:33 +0000 (17:29 +0000)]
show meta data for -Ttree output

8 years agoPut compiler arguments that may contain -l at the end; according to
Ingo Schwarze [Thu, 12 Jan 2017 15:45:05 +0000 (15:45 +0000)]
Put compiler arguments that may contain -l at the end; according to
the people at Alpine Linux, gcc 6 seems to fail when it's at the
beginning.  From Daniel Sabogal via http://git.alpinelinux.org.

8 years agoDo text production for .Bt, .Ex, .Rv, .Ud at the validation stage
Ingo Schwarze [Wed, 11 Jan 2017 17:39:53 +0000 (17:39 +0000)]
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@.

8 years agoUse new NODE_NOSRC and NODE_NOPRT flags for .Bx and .At.
Ingo Schwarze [Tue, 10 Jan 2017 23:36:34 +0000 (23:36 +0000)]
Use new NODE_NOSRC and NODE_NOPRT flags for .Bx and .At.
More rigorous AST and 40 lines less code.

8 years agoFor the .Ux/.Ox family of macros, do text production at the validation
Ingo Schwarze [Tue, 10 Jan 2017 21:59:47 +0000 (21:59 +0000)]
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.

8 years agosimplify; NODE_ENDED does no harm in man(7)
Ingo Schwarze [Tue, 10 Jan 2017 14:09:07 +0000 (14:09 +0000)]
simplify; NODE_ENDED does no harm in man(7)

8 years agounify names of AST node flags; no change of cpp output
Ingo Schwarze [Tue, 10 Jan 2017 13:47:00 +0000 (13:47 +0000)]
unify names of AST node flags; no change of cpp output

8 years agoIntroduce flags NODE_NOSRC and NODE_NOPRT for AST nodes.
Ingo Schwarze [Tue, 10 Jan 2017 12:53:07 +0000 (12:53 +0000)]
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.

8 years agoUse stdout rather than stdin for controlling the terminal
Ingo Schwarze [Mon, 9 Jan 2017 17:49:57 +0000 (17:49 +0000)]
Use stdout rather than stdin for controlling the terminal
such that "cat foo.mdoc | man -l" works.
Issue reported by Christian Neukirchen <chneukirchen at gmail dot com>
and also tested by him on Void Linux with both glibc and musl.
The patch makes sense to millert@.

8 years agoClarify how tabs after .It work
Ingo Schwarze [Mon, 9 Jan 2017 14:10:53 +0000 (14:10 +0000)]
Clarify how tabs after .It work
because this is a really nasty trap for the unwary.

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

8 years agoThe .No macro is not supposed to produce fixed-width font, it is not
Ingo Schwarze [Mon, 9 Jan 2017 12:48:58 +0000 (12:48 +0000)]
The .No macro is not supposed to produce fixed-width font, it is not
the same as .Li, so don't use <code>.
Bug reported by <Anton dot Lindqvist at gmail dot com> on tech@.

8 years agoWarnings and errors that occur during mdoc_validate()
Ingo Schwarze [Mon, 9 Jan 2017 01:37:03 +0000 (01:37 +0000)]
Warnings and errors that occur during mdoc_validate()
or during man_validate() have to affect the mandoc(1) EXIT STATUS.
Many thanks to <Yuri dot Pankov at gmail dot com> (illumos developer)
for reporting this regression.

8 years agoIndentation must be measured in units of the surrounding text,
Ingo Schwarze [Sun, 8 Jan 2017 22:51:55 +0000 (22:51 +0000)]
Indentation must be measured in units of the surrounding text,
not in units of the contained text.  Consequently, "display"
and "lit" class tags must not be on the same element:  First,
"display" must set up the indentation, still using the outer
units, and only after that, "lit" may change the font.

This fixes .Bd -literal which got the wrong indentation.
Bug reported by tb@.

8 years agoFix an assertion failure caused by \z\[u00FF] with -Tps/-Tpdf.
Ingo Schwarze [Sun, 8 Jan 2017 18:16:58 +0000 (18:16 +0000)]
Fix an assertion failure caused by \z\[u00FF] with -Tps/-Tpdf.
Reported by jsg@ after an afl(1) run long ago.

8 years agofrom Tiago Silva <tiagofilipesilva at icloud dot com> long ago
Ingo Schwarze [Sun, 8 Jan 2017 16:38:26 +0000 (16:38 +0000)]
from Tiago Silva <tiagofilipesilva at icloud dot com> long ago

8 years agoTolerate bare tabs in SYNOPSIS .Cd for now.
Ingo Schwarze [Sun, 8 Jan 2017 02:01:17 +0000 (02:01 +0000)]
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.

8 years agoStricter validation of the NAME section, in particular:
Ingo Schwarze [Sun, 8 Jan 2017 00:11:23 +0000 (00:11 +0000)]
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

8 years agosort options list; from jmc@
Ingo Schwarze [Fri, 6 Jan 2017 01:34:57 +0000 (01:34 +0000)]
sort options list; from jmc@

8 years agoescape a macro name that is not intended to be called
Ingo Schwarze [Wed, 28 Dec 2016 22:52:17 +0000 (22:52 +0000)]
escape a macro name that is not intended to be called

8 years agocorrect spelling error; from jmc@
Ingo Schwarze [Wed, 28 Dec 2016 21:51:15 +0000 (21:51 +0000)]
correct spelling error; from jmc@

8 years agoMake the second, section number argument of .Xr mandatory.
Ingo Schwarze [Wed, 28 Dec 2016 17:34:18 +0000 (17:34 +0000)]
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.

8 years agoWhen reporting "whitespace at end of input line" on lines ending with
Ingo Schwarze [Wed, 7 Dec 2016 22:59:29 +0000 (22:59 +0000)]
When reporting "whitespace at end of input line" on lines ending with
roff(7) comments, let the column number in the message point to the
end of the line rather than to the beginning of the comment.
Improvement suggested by bluhm@.

8 years agosync with NetBSD: add four new libraries;
Ingo Schwarze [Wed, 23 Nov 2016 20:22:13 +0000 (20:22 +0000)]
sync with NetBSD: add four new libraries;
triggered by a smaller patch from kamil@ via wiz@

8 years agoDo not install libmandoc.a by default.
Ingo Schwarze [Sat, 19 Nov 2016 15:24:51 +0000 (15:24 +0000)]
Do not install libmandoc.a by default.
The only environment where it is ever needed is NetBSD base.
Even NetBSD ports and pkgsrc should better not install it.
Triggered by a question from bentley@.

8 years agowarn about trailing whitespace at the end of comments;
Ingo Schwarze [Thu, 10 Nov 2016 12:47:50 +0000 (12:47 +0000)]
warn about trailing whitespace at the end of comments;
missing feature noticed by jmc@

8 years agodocument improved tagging functionality
Ingo Schwarze [Tue, 8 Nov 2016 17:05:29 +0000 (17:05 +0000)]
document improved tagging functionality

8 years agouse .Fn in custom sections for tagging, in addition to in DESCRIPTION;
Ingo Schwarze [Tue, 8 Nov 2016 16:38:21 +0000 (16:38 +0000)]
use .Fn in custom sections for tagging, in addition to in DESCRIPTION;
written on the TGV Paris-Strassbourg

8 years agotag leading .Dv, .Li, and .No in .It;
Ingo Schwarze [Tue, 8 Nov 2016 16:29:44 +0000 (16:29 +0000)]
tag leading .Dv, .Li, and .No in .It;
written on the TGV Paris-Strassbourg

8 years agoimplement tag priority 0, which will tag only keys that appear as
Ingo Schwarze [Tue, 8 Nov 2016 16:23:58 +0000 (16:23 +0000)]
implement tag priority 0, which will tag only keys that appear as
tag candidates exactly once, and use it for .Em and .Sy;
written on the TGV Toulouse-Paris

8 years agogenerate two tag entries from list entries of the form
Ingo Schwarze [Tue, 8 Nov 2016 16:04:57 +0000 (16:04 +0000)]
generate two tag entries from list entries of the form
.It Macro tag1 ... | Macro tag2 ...
written on the TGV Toulouse-Paris

8 years agoskip leading \& and \e in tags
Ingo Schwarze [Tue, 8 Nov 2016 15:57:28 +0000 (15:57 +0000)]
skip leading \& and \e in tags

8 years agosupport more than one tag entry for the same search term;
Ingo Schwarze [Tue, 8 Nov 2016 15:28:17 +0000 (15:28 +0000)]
support more than one tag entry for the same search term;
general idea discussed with bcook@ during l2k16

8 years agocast off_t and uint64_t for printf(3)
Ingo Schwarze [Sat, 22 Oct 2016 10:09:27 +0000 (10:09 +0000)]
cast off_t and uint64_t for printf(3)
to make sure that widths match on all platforms;
from Ed Maste <emaste at freebsd dot org>;
OK guenther@

8 years agotypo in informational message: s/UTF_LOCALE/UTF8_LOCALE/
Ingo Schwarze [Thu, 20 Oct 2016 18:47:49 +0000 (18:47 +0000)]
typo in informational message: s/UTF_LOCALE/UTF8_LOCALE/

8 years ago0x%llu is a bad idea, make that 0x%llx;
Ingo Schwarze [Thu, 20 Oct 2016 16:31:00 +0000 (16:31 +0000)]
0x%llu is a bad idea, make that 0x%llx;
noticed while investigating a report from Ed Maste

8 years agost_size is off_t, which is signed, so use %lld rather than %llu;
Ingo Schwarze [Thu, 20 Oct 2016 16:12:56 +0000 (16:12 +0000)]
st_size is off_t, which is signed, so use %lld rather than %llu;
noticed by Ed Maste when compiling on FreeBSD

8 years agoAvoid the confusion that -a might require a section argument; it does not.
Ingo Schwarze [Wed, 19 Oct 2016 22:20:36 +0000 (22:20 +0000)]
Avoid the confusion that -a might require a section argument; it does not.
Triggered by a question from <jmates at ee dot washington at edu>.
OK jmc@.

8 years agobring back support for sorting
Ingo Schwarze [Tue, 18 Oct 2016 23:58:12 +0000 (23:58 +0000)]
bring back support for sorting

8 years agosync with OpenBSD
Ingo Schwarze [Tue, 18 Oct 2016 23:13:25 +0000 (23:13 +0000)]
sync with OpenBSD

8 years agoThe termination condition of the iteration logic in page_bymacro()
Ingo Schwarze [Tue, 18 Oct 2016 22:27:25 +0000 (22:27 +0000)]
The termination condition of the iteration logic in page_bymacro()
was overzealous.  Consequently, macro=substr and macro~regexp searches
only returned all pages containing the first matching macro value,
rather than all pages containing any of the matching macro values.
Bug reported by tb@ - thanks!

8 years agoCompat glue for the FreeBSD comparison function prototype for fts_open(3)
Ingo Schwarze [Tue, 18 Oct 2016 16:06:44 +0000 (16:06 +0000)]
Compat glue for the FreeBSD comparison function prototype for fts_open(3)
which differs from what most other systems use.
While here, improve diagnostic output of ./configure tests.

8 years agoupdate after rev. 1.5 of dba.c
Ingo Schwarze [Tue, 18 Oct 2016 16:01:40 +0000 (16:01 +0000)]
update after rev. 1.5 of dba.c

8 years agoSimplify and correct support for reproducible builds, such that database
Ingo Schwarze [Tue, 18 Oct 2016 14:15:33 +0000 (14:15 +0000)]
Simplify and correct support for reproducible builds, such that database
entries come in a well-defined order even in the presence of MLINKS.
Do this by using the compar() argument of fts_open(3) rather than
trying to sort later, which missed some cases.
This also shortens the code by a few lines.

Diff from Ed Maste <emaste @ FreeBSD>, adapted to our tree
and tweaked a bit by me, final version confirmed by Ed.

8 years agolink to http://mdocml.bsd.lv/mdoc/ below SEE ALSO;
Ingo Schwarze [Tue, 11 Oct 2016 17:30:33 +0000 (17:30 +0000)]
link to http://mdocml.bsd.lv/mdoc/ below SEE ALSO;
tweak and OK jmc@

8 years agoDelete complicated code dealing with .Bl -tag without -width,
Ingo Schwarze [Sun, 9 Oct 2016 18:16:56 +0000 (18:16 +0000)]
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).

8 years agoWe cannot use fputs(3) in passthrough() because the stdout stream
Ingo Schwarze [Sun, 18 Sep 2016 15:47:45 +0000 (15:47 +0000)]
We cannot use fputs(3) in passthrough() because the stdout stream
might be in stdio wide orientation due to prior formatting of an
unformatted manual in man -aTutf8 mode.  So for now, use fflush(3)
followed by unbuffered write(2) instead.  Fixes output corruption
on glibc discovered on Linux while testing a diff to fix a loosely
related bug reported by <jmates at ee dot washington dot edu>.

I detest the concept of stdio stream orientation.  One day, i will
rewrite term_ascii.c to always use narrow streams, even in UTF-8
output mode.  But that's too much work for today.

8 years agoMake sure an output device is allocated before calling terminal_sepline(),
Ingo Schwarze [Sun, 18 Sep 2016 15:22:08 +0000 (15:22 +0000)]
Make sure an output device is allocated before calling terminal_sepline(),
fixing a NULL pointer access that happened when the first of multiple pages
shown was preformatted, as in "man -a groff troff".
Crash reported by <jmates at ee dot washington dot edu> on bugs@, thanks!

8 years agominor tbl(7) column spacing and wrapping issues in lftp(1)
Ingo Schwarze [Tue, 13 Sep 2016 12:09:01 +0000 (12:09 +0000)]
minor tbl(7) column spacing and wrapping issues in lftp(1)

8 years agouse the proper HTML escape for double quote ("): &quot; not &quote;
Ingo Schwarze [Mon, 12 Sep 2016 00:06:20 +0000 (00:06 +0000)]
use the proper HTML escape for double quote ("): &quot; not &quote;
patch from bentley@

8 years agomove zaurus down to the discontinued architectures
Ingo Schwarze [Sat, 3 Sep 2016 21:24:56 +0000 (21:24 +0000)]
move zaurus down to the discontinued architectures

8 years agoWhen "makewhatis -d" tries to add to a database that doesn't (yet) exist,
Ingo Schwarze [Fri, 2 Sep 2016 14:03:30 +0000 (14:03 +0000)]
When "makewhatis -d" tries to add to a database that doesn't (yet) exist,
silently create it from scratch instead of printing a warning.
The annoying warning message was reported by ajacoutot@, and espie@
convincingly argues that a non-existing database can be considered
equivalent to an empty one.

8 years agoremove "sparc" from a comment
Ingo Schwarze [Thu, 1 Sep 2016 15:08:04 +0000 (15:08 +0000)]
remove "sparc" from a comment

8 years agomove "sparc" down to discontinued architectures
Ingo Schwarze [Thu, 1 Sep 2016 15:07:24 +0000 (15:07 +0000)]
move "sparc" down to discontinued architectures

8 years agoWhen the database is corrupt in the sense of containing invalid
Ingo Schwarze [Tue, 30 Aug 2016 22:01:07 +0000 (22:01 +0000)]
When the database is corrupt in the sense of containing invalid
pointers in the pages table, do not access NULL pointers, but
gracefully handle the errors.
Similar patches will be needed for the macro tables, too.
<attila at stalphonsos dot com> audited the code and pointed out to me
that dbm_get() can return NULL for corrupted databases, but that isn't
handled properly at various places.

8 years agoless confusing warning message about negative offsets
Ingo Schwarze [Tue, 30 Aug 2016 21:37:24 +0000 (21:37 +0000)]
less confusing warning message about negative offsets

8 years agoIf a line inside .Bl -column starts with a tab character
Ingo Schwarze [Sun, 28 Aug 2016 16:15:12 +0000 (16:15 +0000)]
If a line inside .Bl -column starts with a tab character
and there was no preceding .It macro, do not read the byte
before the beginning of the line buffer.
Found by tb@ with afl@.

8 years agoWhen trying to edit an existing database with makewhatis(8) -d or -u
Ingo Schwarze [Mon, 22 Aug 2016 16:15:26 +0000 (16:15 +0000)]
When trying to edit an existing database with makewhatis(8) -d or -u
but reading the database fails, report the full path to the database
on standard error, and mention that the database is automatically
recreated from scratch.
Suggested by espie@.

8 years agoWhen running into a mandoc.db(5) file still using the obsolete
Ingo Schwarze [Mon, 22 Aug 2016 16:07:16 +0000 (16:07 +0000)]
When running into a mandoc.db(5) file still using the obsolete
format based on SQLite 3, say so in words that mortals can
understand rather than babbling about hex magic.
Suggested by espie@.

8 years agoWhen a mismatching end macro occurs while at least two nested blocks
Ingo Schwarze [Sat, 20 Aug 2016 17:59:34 +0000 (17:59 +0000)]
When a mismatching end macro occurs while at least two nested blocks
are open, all except the innermost open block got a bogus MDOC_ENDED
marker, in some situations triggering segfaults down the road
which tb@ found with afl(1).
Fix the logic error by figuring out up front whether an end macro
has a matching body, and if it hasn't, don't mark any blocks as broken.

8 years agoWhen scanning upwards for a column list to put a .Ta macro in,
Ingo Schwarze [Sat, 20 Aug 2016 15:58:21 +0000 (15:58 +0000)]
When scanning upwards for a column list to put a .Ta macro in,
ignore body end markers of lists breaking other blocks.
Fixing a logical error that caused a NULL deref found by tb@ with afl(1).

8 years agoIf a column list starts with implicit rows (that is, rows without .It)
Ingo Schwarze [Sat, 20 Aug 2016 14:43:50 +0000 (14:43 +0000)]
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).

8 years agofix an fd leak; patch from jsg@
Ingo Schwarze [Thu, 18 Aug 2016 09:02:34 +0000 (09:02 +0000)]
fix an fd leak; patch from jsg@

8 years agoWhen the content of a manual page does not specify a section, the
Ingo Schwarze [Wed, 17 Aug 2016 20:46:56 +0000 (20:46 +0000)]
When the content of a manual page does not specify a section, the
empty string got added to the list of sections, breaking the database
format slightly and causing the page to not be considered part of
any section, not even if a section could be deduced from the directory
or from the file name.
Bug found due to the bogus pcredemo(3) "manual" in the pcre-8.38p0 package.

8 years agoWhen reading back a mandoc.db(5) file in order to apply incremental
Ingo Schwarze [Wed, 17 Aug 2016 18:59:37 +0000 (18:59 +0000)]
When reading back a mandoc.db(5) file in order to apply incremental
changes, do not prepend a stray NAME_FILE (0x10) byte to the first
names of pages.
Bug found while investigating another issue reported by sthen@.

8 years agoMake sure manuals in architecture-independent directories are treated
Ingo Schwarze [Wed, 17 Aug 2016 18:10:39 +0000 (18:10 +0000)]
Make sure manuals in architecture-independent directories are treated
as architecture-independent even if they abuse the third (architecture)
argument of the .Dt macro for random stuff like "freetds reference manual".
While the .Dt syntax is not the same as the .TH syntax in man(7),
punishing offenders by treating them as architecture-dependent and
hence completely excluding them from searches is too severe.
Problem reported by sthen@.

8 years agoEven after switching from a pending head to the body, we have to
Ingo Schwarze [Thu, 11 Aug 2016 13:30:25 +0000 (13:30 +0000)]
Even after switching from a pending head to the body, we have to
continue scanning upwards, because the enclosing block might already
be pending as well, e.g. .Bl .Bl .It Bo .El .It.
Tree corruption leading to a later NULL deref found by tb@ with afl(1).

8 years agooops, fix stupid typo in previous
Ingo Schwarze [Thu, 11 Aug 2016 11:39:46 +0000 (11:39 +0000)]
oops, fix stupid typo in previous

8 years agoIf a .Bd display is on the one hand doomed to be deleted because
Ingo Schwarze [Thu, 11 Aug 2016 10:47:16 +0000 (10:47 +0000)]
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).

8 years agoDon't deref NULL if the only child of the first .Sh is an empty
Ingo Schwarze [Wed, 10 Aug 2016 20:17:50 +0000 (20:17 +0000)]
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.)

8 years agomove armish and hppa64 down in the dropdown box; reminded by jmc@
Ingo Schwarze [Wed, 10 Aug 2016 18:39:23 +0000 (18:39 +0000)]
move armish and hppa64 down in the dropdown box; reminded by jmc@

8 years agoWhen trying to figure out which C compiler make(1) wants to use,
Ingo Schwarze [Wed, 10 Aug 2016 12:50:24 +0000 (12:50 +0000)]
When trying to figure out which C compiler make(1) wants to use,
pass it the POSIX -s option.  On most systems, this won't make a
difference, but Bdale Garbee reported that the make(1) on his Debian
system, most likely some version of gmake, breaks Makefile.local
by printing some 'entering directory' messages.  I failed to reproduce
and Bdale didn't report back, but judging from gmake source code,
this is likely to help and unlikely to do harm elsewhere.

8 years agoDon't printf("%s", NULL) if .It has a macro as an argument
Ingo Schwarze [Wed, 10 Aug 2016 12:29:38 +0000 (12:29 +0000)]
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).