]> git.cameronkatri.com Git - mandoc.git/log
mandoc.git
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).

8 years agoWhen validating a .Bl list that defaults to -item for want of a type,
Ingo Schwarze [Wed, 10 Aug 2016 12:06:41 +0000 (12:06 +0000)]
When validating a .Bl list that defaults to -item for want of a type,
don't let a subsequent -width access mdoc_argnames[] out of bounds.
Found by tb@ with afl(1).

8 years agoFix assertion failures caused by whitespace inside \o'' (overstrike)
Ingo Schwarze [Wed, 10 Aug 2016 11:03:43 +0000 (11:03 +0000)]
Fix assertion failures caused by whitespace inside \o'' (overstrike)
sequences that jsg@ found with afl(1):
* Avoid writing \t\b in term.c.
* Handle trailing \b in term_ps.c.

8 years agofix printf("%s", NULL);
Ingo Schwarze [Tue, 9 Aug 2016 15:09:27 +0000 (15:09 +0000)]
fix printf("%s", NULL);
found while investigating an unrelated bug report from jsg@

8 years agoThe concept of endianness seems to be somewhat newfangled, so the
Ingo Schwarze [Fri, 5 Aug 2016 23:15:08 +0000 (23:15 +0000)]
The concept of endianness seems to be somewhat newfangled, so the
respective conversion functions are not yet properly standardized.
Rumour has it that POSIX is working on it, though.
For now, sprinkle some configuration glue.

8 years agoReally protect <err.h> as already promised in the previous commit message.
Ingo Schwarze [Fri, 5 Aug 2016 23:08:03 +0000 (23:08 +0000)]
Really protect <err.h> as already promised in the previous commit message.

8 years agomissing <endian.h> reported by Bapt@iste Daroussin, found on FreeBSD
Ingo Schwarze [Fri, 5 Aug 2016 21:38:11 +0000 (21:38 +0000)]
missing <endian.h> reported by Bapt@iste Daroussin, found on FreeBSD

8 years agofix a typo that prevented names from .Dt from getting priority
Ingo Schwarze [Fri, 5 Aug 2016 17:22:45 +0000 (17:22 +0000)]
fix a typo that prevented names from .Dt from getting priority
over names from .Sh NAME

8 years agoFix an assertion failure that happened when trying to add a page
Ingo Schwarze [Thu, 4 Aug 2016 09:33:57 +0000 (09:33 +0000)]
Fix an assertion failure that happened when trying to add a page
with makewhatis -d to a completely empty database.
Reported by Mark Patruck <mark at wrapped dot cx>, thanks!

8 years agoPOSIX allows PATH_MAX to not be defined, meaning "unlimited".
Ingo Schwarze [Tue, 2 Aug 2016 11:09:46 +0000 (11:09 +0000)]
POSIX allows PATH_MAX to not be defined, meaning "unlimited".
Found by Aaron M. Ucko <amu at alum dot mit dot edu> on the GNU Hurd,
via Bdale Garbee, https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=829624

Also add EFTYPE at two places where it was forgotten.

8 years agoRepair makewhatis -t, regression in rev. 1.221 reported by naddy@.
Ingo Schwarze [Mon, 1 Aug 2016 20:53:13 +0000 (20:53 +0000)]
Repair makewhatis -t, regression in rev. 1.221 reported by naddy@.

8 years agoAdjust MANDOC_DB and bump MANDOCDB_VERSION now that
Ingo Schwarze [Mon, 1 Aug 2016 12:31:00 +0000 (12:31 +0000)]
Adjust MANDOC_DB and bump MANDOCDB_VERSION now that
this was put into production in OpenBSD-current.

8 years agodocument the new file format
Ingo Schwarze [Mon, 1 Aug 2016 12:27:15 +0000 (12:27 +0000)]
document the new file format

8 years agoSome base system pages, for example perl(1), contain non-ASCII
Ingo Schwarze [Sun, 31 Jul 2016 23:37:23 +0000 (23:37 +0000)]
Some base system pages, for example perl(1), contain non-ASCII
characters in their source code, so switch on charset autodetection
in the same way as in man(1) itself.
Issue reported by Pavan Maddamsetti at gmail dot com on bugs@.

8 years agoAutodetect a suitable locale for -Tutf8 mode,
Ingo Schwarze [Sun, 31 Jul 2016 09:29:13 +0000 (09:29 +0000)]
Autodetect a suitable locale for -Tutf8 mode,
and allow overriding it manually.
Based on a patch from Svyatoslav Mishyn <juef at openmailbox dot org>
tweaked by me.
The idea originally came up in a conversation with Markus Waldeck.

8 years agoSort sections and architectures in the pages table.
Ingo Schwarze [Fri, 29 Jul 2016 15:29:32 +0000 (15:29 +0000)]
Sort sections and architectures in the pages table.

8 years agoSort pages in the pages table by file names.
Ingo Schwarze [Fri, 29 Jul 2016 15:26:37 +0000 (15:26 +0000)]
Sort pages in the pages table by file names.

8 years agoNo need to populate the TYPE_arch and TYPE_sec bits, the information
Ingo Schwarze [Fri, 29 Jul 2016 15:23:57 +0000 (15:23 +0000)]
No need to populate the TYPE_arch and TYPE_sec bits, the information
is provided directly to dba_page_add() in dbadd_mlink()
and to dba_page_new() in dbadd().

No need for a dedicated loop for NAME_FILE.
It's done in dbadd_mlink() anyway.

In this context, also record section numbers taken from filenames
and from .Dt and .TH macros, architectures taken from .Dt macros,
and fix the filtering of duplicate filename entries.

8 years agoAutodetect if -lrt is needed for nanosleep(3).
Ingo Schwarze [Wed, 20 Jul 2016 14:03:06 +0000 (14:03 +0000)]
Autodetect if -lrt is needed for nanosleep(3).
Helpful for Solaris 9 and 10.
Reminded by Thomas Klausner.

8 years agotag_signal() is dead; from LLVM via Christos Zoulas
Ingo Schwarze [Wed, 20 Jul 2016 13:03:24 +0000 (13:03 +0000)]
tag_signal() is dead; from LLVM via Christos Zoulas

8 years agoLinux compatibility: Work around the lack of EFTYPE and protect <err.h>.
Ingo Schwarze [Wed, 20 Jul 2016 00:23:14 +0000 (00:23 +0000)]
Linux compatibility: Work around the lack of EFTYPE and protect <err.h>.

8 years agoNow that our man.conf(5) format is mature and extremely simple,
Ingo Schwarze [Tue, 19 Jul 2016 22:40:33 +0000 (22:40 +0000)]
Now that our man.conf(5) format is mature and extremely simple,
delete manpath(1) support.  With the mandoc-based man(1), manpath(1)
is utterly useless.  Just set MANPATH_DEFAULT in configure.local
for sane operating system defaults, use man.conf(5) for machine-
specific modifications, and use ${MANPATH}, -m, and -M for user
preferences.

8 years agoRemove the dependency on SQLite without loss of functionality.
Ingo Schwarze [Tue, 19 Jul 2016 21:31:55 +0000 (21:31 +0000)]
Remove the dependency on SQLite without loss of functionality.
Stop supporting systems that don't have mmap(3).
Drop the obsolete names_check() now that we deleted MLINKS.

8 years agoRemove one outdated comment and fix one typo
Ingo Schwarze [Tue, 19 Jul 2016 17:56:04 +0000 (17:56 +0000)]
Remove one outdated comment and fix one typo
noted by Jan Stary <hans at stare dot cz>.

8 years agoSince the mdoc/man parser unification, the parser is always allocated
Ingo Schwarze [Tue, 19 Jul 2016 16:22:52 +0000 (16:22 +0000)]
Since the mdoc/man parser unification, the parser is always allocated
in mparse_alloc(), so delete all the curp->man == NULL checks.
Triggered by a patch from Christos Zoulas suggesting to add
yet another such check.

8 years agoUse __attribute__((__format__ throughout.
Ingo Schwarze [Tue, 19 Jul 2016 13:36:13 +0000 (13:36 +0000)]
Use __attribute__((__format__ throughout.
Triggered by a smaller patch from Christos Zoulas.

While here, unify style, move several config tests to config.h,
and delete the useless MANDOC_CONFIG_H.

8 years agocope with -Wmissing-prototypes
Ingo Schwarze [Mon, 18 Jul 2016 18:35:05 +0000 (18:35 +0000)]
cope with -Wmissing-prototypes

8 years agoTo remove the const qualifier from a pointer to an object - either
Ingo Schwarze [Fri, 15 Jul 2016 19:33:01 +0000 (19:33 +0000)]
To remove the const qualifier from a pointer to an object - either
because we know it is actually mutable or because we are passing
it to a function that doesn't accept a const object but won't
actually attempt to modify it - simply casting from (const type *)
to (type *) is legal C and clearly expresses the intent.
So get rid of the obfuscating UNCONST macro.
Basic idea discussed with guenther@.

8 years agoFix previous: the mandocdb() prototype was already there, it just
Ingo Schwarze [Fri, 15 Jul 2016 18:50:20 +0000 (18:50 +0000)]
Fix previous: the mandocdb() prototype was already there, it just
hid among static functions, as noticed by tedu@ (my bad).

8 years agoadd missing prototypes, no code change;
Ingo Schwarze [Fri, 15 Jul 2016 18:03:45 +0000 (18:03 +0000)]
add missing prototypes, no code change;
noticed by Christos Zoulas with -Wmissing-prototypes

8 years agoSanitize the environment when calling make(1) to autodetect ${CC}.
Ingo Schwarze [Fri, 15 Jul 2016 15:08:37 +0000 (15:08 +0000)]
Sanitize the environment when calling make(1) to autodetect ${CC}.
Sevan Janiyan found during testing on AIX that ${CC} could leak in.

8 years agofinal 1.13.4 release notes VERSION_1_13_4
Ingo Schwarze [Thu, 14 Jul 2016 11:09:06 +0000 (11:09 +0000)]
final 1.13.4 release notes