]> git.cameronkatri.com Git - mandoc.git/log
mandoc.git
7 years agoASCII characters that are special to roff
Ingo Schwarze [Thu, 27 Apr 2017 17:08:04 +0000 (17:08 +0000)]
ASCII characters that are special to roff

7 years agoDelete the manpage(1) utility.
Ingo Schwarze [Mon, 24 Apr 2017 23:32:00 +0000 (23:32 +0000)]
Delete the manpage(1) utility.
It was never enabled in any release, nor was a manual ever written.

In general, we want to simplify the user interface rather than
succumb to featurism.  Consequently, integrating manpage(1)
into the main binary would seem like a dubious direction.

7 years agoContinue parser unification:
Ingo Schwarze [Mon, 24 Apr 2017 23:06:17 +0000 (23:06 +0000)]
Continue parser unification:
* Make enum rofft an internal interface as enum roff_tok in "roff.h".
* Represent mdoc and man macros in enum roff_tok.
* Make TOKEN_NONE a proper enum value and use it throughout.
* Put the prologue macros first in the macro tables.
* Unify mdoc_macroname[] and man_macroname[] into roff_name[].

7 years agoMore thoroughly reject direct access to unintended files, such that
Ingo Schwarze [Wed, 19 Apr 2017 01:00:03 +0000 (01:00 +0000)]
More thoroughly reject direct access to unintended files, such that
URIs like http://man.openbsd.org/OpenBSD-current/mandoc.db and
http://man.openbsd.org/OpenBSD-current/man1/ do not cause display
of garbage.

7 years agoNow that global -i is gone, pass -i through to the apropos(1)
Ingo Schwarze [Tue, 18 Apr 2017 16:01:20 +0000 (16:01 +0000)]
Now that global -i is gone, pass -i through to the apropos(1)
expression parser, such that "apropos -i 'Nm~dump\>'"
finds kdump(1) and WCOREDUMP(2) and you don't need
to type the counter-intuitive "apropos -- -i 'Nm~dump\>'".

7 years agoDelete the undocumented and unimplemented man(1) -i (interactive
Ingo Schwarze [Tue, 18 Apr 2017 15:27:09 +0000 (15:27 +0000)]
Delete the undocumented and unimplemented man(1) -i (interactive
apropos) option.  It will not be implemented.  Featurism isn't the
plan for the future; simplicity is.

7 years agoThe apropos(1) manual still documents the unary -i operator for
Ingo Schwarze [Tue, 18 Apr 2017 15:06:49 +0000 (15:06 +0000)]
The apropos(1) manual still documents the unary -i operator for
regular expression search terms, but it appears that somewhere
along the way, the implementation got lost, so restore it.
Bug found while investigating other reports from Gonzalo Tornaria.

7 years agoFix previous: i forgot explicit NUL termination;
Ingo Schwarze [Tue, 18 Apr 2017 13:57:56 +0000 (13:57 +0000)]
Fix previous: i forgot explicit NUL termination;
noticed by Gonzalo <Tornaria at cmat dot edu dot uy>, thanks!

7 years agoRestore -kO Nd, -kO Nm, -kO sec, and -kO arch to working order.
Ingo Schwarze [Mon, 17 Apr 2017 20:05:08 +0000 (20:05 +0000)]
Restore -kO Nd, -kO Nm, -kO sec, and -kO arch to working order.
They got broken in the SQLite removal.
As opposed to the rest of -kO, they are no longer very useful,
but they are certainly not supposed to fail assertions.
Issue reported by Gonzalo Tornaria <tornaria at cmat dot edu dot uy>.

7 years agoadjust tests to recent .Lk improvements
Ingo Schwarze [Mon, 17 Apr 2017 13:37:40 +0000 (13:37 +0000)]
adjust tests to recent .Lk improvements

7 years agoimplement display of long .Lk URIs to match -Tascii
Ingo Schwarze [Mon, 17 Apr 2017 13:26:47 +0000 (13:26 +0000)]
implement display of long .Lk URIs to match -Tascii

7 years agoFix handling of trailing punctuation in .Lk.
Ingo Schwarze [Mon, 17 Apr 2017 12:53:29 +0000 (12:53 +0000)]
Fix handling of trailing punctuation in .Lk.
This macro is unusual in so far as trailing punction needs to remain
inside the scope because it must be inside, not after the display
of long URIs in terminal output mode.
Improves formatting of fw_update(1), help(1), less(1), sendbug(1),
acx(4), inet6(4), ipsec(4), oce(4), isakmpd.conf(5), afterboot(8),
release(8), traceroute(8).

7 years agoShow long .Lk URIs in like an indented display, similar to groff.
Ingo Schwarze [Fri, 14 Apr 2017 19:35:22 +0000 (19:35 +0000)]
Show long .Lk URIs in like an indented display, similar to groff.
Suggested by bentley@.

7 years agoDo not make the colon after the .Lk link text italic.
Ingo Schwarze [Fri, 14 Apr 2017 18:25:04 +0000 (18:25 +0000)]
Do not make the colon after the .Lk link text italic.
I just pushed the same change to GNU troff.

7 years agodelete documentation of some stuff that no longer exists,
Ingo Schwarze [Thu, 30 Mar 2017 22:22:05 +0000 (22:22 +0000)]
delete documentation of some stuff that no longer exists,
mostly about SQLite3; noticed by Jan Stary <hans at stare dor cz>

7 years agosimplify the SYNOPSIS as well, just like the option lists;
Ingo Schwarze [Mon, 27 Mar 2017 18:51:36 +0000 (18:51 +0000)]
simplify the SYNOPSIS as well, just like the option lists;
suggested by and OK jmc@

7 years agoFor some options that are rarely needed in mandoc(1),
Ingo Schwarze [Mon, 27 Mar 2017 15:17:11 +0000 (15:17 +0000)]
For some options that are rarely needed in mandoc(1),
delete the descriptions and point to man(1) instead.
Inspired by apropos.1 rev. 1.43.

7 years agoSimplify: mention at one place that -fkl override each other,
Ingo Schwarze [Mon, 27 Mar 2017 14:40:39 +0000 (14:40 +0000)]
Simplify: mention at one place that -fkl override each other,
rather than stating it separately for each option.
Suggested, OKed, and tweaked by jmc@.

7 years agoFor some options that are rarely needed in apropos(1) and man(1),
Ingo Schwarze [Sat, 25 Mar 2017 12:46:36 +0000 (12:46 +0000)]
For some options that are rarely needed in apropos(1) and man(1),
delete the verbose descriptions and point to man(1) and mandoc(1),
respectively, instead.  That shortens the pages and makes them
easier to read.
Tweaks and OK jmc@, based in part on ideas from tedu@.

7 years agosimplify description of -S and -w, point from EXIT STATUS
Ingo Schwarze [Wed, 22 Mar 2017 13:31:49 +0000 (13:31 +0000)]
simplify description of -S and -w, point from EXIT STATUS
to mandoc(1) for details, and remove duplicate .Xr to whatis(1);
OK jmc@

7 years agosimplify .Nd; to display manuals, use man(1) instead;
Ingo Schwarze [Tue, 21 Mar 2017 18:25:51 +0000 (18:25 +0000)]
simplify .Nd; to display manuals, use man(1) instead;
OK jmc@

7 years agodelete documentation of a hack that was removed years ago
Ingo Schwarze [Tue, 21 Mar 2017 18:06:12 +0000 (18:06 +0000)]
delete documentation of a hack that was removed years ago

7 years agoSilently ignore invalid -m input formats rather than erroring out.
Ingo Schwarze [Mon, 20 Mar 2017 14:32:24 +0000 (14:32 +0000)]
Silently ignore invalid -m input formats rather than erroring out.
As observed by Jan Stary <hans at stare dot cz>, this is useful such
that after 'alias man="man -m $HOME/man"', 'man -l foo.1' still works.
Simplify and shorten the description of -m, and use .Ic for macros.

7 years agominor issues found with mandoc -Tlint
Ingo Schwarze [Sat, 18 Mar 2017 19:56:01 +0000 (19:56 +0000)]
minor issues found with mandoc -Tlint

7 years agoCorrect description of MANPATH, and a few more improvements
Ingo Schwarze [Sat, 18 Mar 2017 19:51:19 +0000 (19:51 +0000)]
Correct description of MANPATH, and a few more improvements
to the ENVIRONMENT section; OK jmc@

7 years agoSimplify: write HTTP 303 redirects with relative locations.
Ingo Schwarze [Sat, 18 Mar 2017 16:48:24 +0000 (16:48 +0000)]
Simplify: write HTTP 303 redirects with relative locations.
Suggested by bentley@.

Delete the HTTP_HOST configuration variable that is now obsolete.

7 years agoBugfix: use SCRIPT_NAME for .Xr hyperlinks.
Ingo Schwarze [Sat, 18 Mar 2017 16:19:11 +0000 (16:19 +0000)]
Bugfix: use SCRIPT_NAME for .Xr hyperlinks.
Patch from <andreas at AndreasVoegele dot com>.

7 years agoDocument man(1) section selection priority,
Ingo Schwarze [Fri, 17 Mar 2017 17:24:41 +0000 (17:24 +0000)]
Document man(1) section selection priority,
and correct description of apropos(1) output search order.
Suggested by tb@.

7 years agoUpdate HISTORY and AUTHORS: we no longer use SQLite.
Ingo Schwarze [Fri, 17 Mar 2017 12:56:57 +0000 (12:56 +0000)]
Update HISTORY and AUTHORS: we no longer use SQLite.
Outdated information reported by an Anonymous Coward on undeadly.org.

7 years agoFix regression in mdoc_html.c 1.275, man_html 1.134:
Ingo Schwarze [Fri, 17 Mar 2017 12:10:16 +0000 (12:10 +0000)]
Fix regression in mdoc_html.c 1.275, man_html 1.134:
For .Sh, .Ss, .SH, .SS, only write selflink if an id could be constructed.
Crash reported by Raf Czlonka <rczlonka at gmail dot com>,
analysis of root cause by natano@

7 years agoIn URIs in apropos(1) result tables,
Ingo Schwarze [Wed, 15 Mar 2017 13:49:50 +0000 (13:49 +0000)]
In URIs in apropos(1) result tables,
only write the manpath if it does not match the default.

7 years agoMention the manual page name and section in the HTML page <title>.
Ingo Schwarze [Wed, 15 Mar 2017 13:18:53 +0000 (13:18 +0000)]
Mention the manual page name and section in the HTML page <title>.
Based on a patch from <Anton dot Lindqvist at gmail dot com>,
but simplified and also covering apropos(1) search results.

7 years agoMinimal support for deep linking into man(7) pages.
Ingo Schwarze [Wed, 15 Mar 2017 11:29:53 +0000 (11:29 +0000)]
Minimal support for deep linking into man(7) pages.
As the man(7) language does not provide semantic markup,
only .SH, .SS, and .UR become anchors for now.

7 years agoIt's annoying that people keep writing URIs including redundant parts
Ingo Schwarze [Wed, 15 Mar 2017 10:17:29 +0000 (10:17 +0000)]
It's annoying that people keep writing URIs including redundant parts
like "/OpenBSD-current/manN/".  To discourage that, let man.cgi(8)
redirect search form results to nice, concise URIs.

7 years agoSlightly increase widths calculated from string lengths (mainly
Ingo Schwarze [Tue, 14 Mar 2017 01:35:15 +0000 (01:35 +0000)]
Slightly increase widths calculated from string lengths (mainly
for .Bl -tag lists and SYNOPSIS .Nm blocks), such that the text
still fits even if it is printed in bold font.
This is an ugly band aid - but implementing font-dependent width
measurements would be a major project and even more difficult
for HTML than for PostScript.

Issue reported by Jan Stary <hans at stare dot cz>.

7 years agoPort ctags-style, less(1) :t internal searching from terminal output
Ingo Schwarze [Mon, 13 Mar 2017 20:22:18 +0000 (20:22 +0000)]
Port ctags-style, less(1) :t internal searching from terminal output
to HTML output.  For certain macros appearing at the beginning of .It
heads, write HTML id="..." attributes such that deep linking works.
Write HTML <a> attributes such that you can easily copy out link
targets with the mouse.  Try: http://man.openbsd.org/vmctl.8#create

Feature suggested by <guettliml at Thomas dash Guettler dot de>,
some details of the design and implementation by me.

7 years agoPrint title="..." in addition to id="..." attributes for macro keys
Ingo Schwarze [Mon, 13 Mar 2017 19:01:38 +0000 (19:01 +0000)]
Print title="..." in addition to id="..." attributes for macro keys
that can be searched for by apropos(1), such that you see the
semantic function in a tooltip when hovering with the mouse.

7 years agotest infinite recursion in eqn(7) "define" statements
Ingo Schwarze [Sat, 11 Mar 2017 16:04:18 +0000 (16:04 +0000)]
test infinite recursion in eqn(7) "define" statements

7 years agoImprove detection of recursive eqn(7) "define" statements:
Ingo Schwarze [Sat, 11 Mar 2017 15:43:04 +0000 (15:43 +0000)]
Improve detection of recursive eqn(7) "define" statements:
Do not only catch "define key 'key other stuff'",
but also "define key 'other stuff key'".
Fixing infinite loop found by tb@ with afl(1).

7 years agoIn markdown, autolinks are dangerous. Different compilers disagree
Ingo Schwarze [Sat, 11 Mar 2017 12:35:45 +0000 (12:35 +0000)]
In markdown, autolinks are dangerous.  Different compilers disagree
with respect to what constitutes a valid autolink, and if a compiler
deems an autolink invalid, the input turns into an unintended and
potentially harmful raw HTML tag.  So, never write autolinks.
Instead of <link>, write [link](link).
Instead of <addr>, write [addr](mailto:addr).

Issue pointed out by bentley@, who also agrees with the general
direction of the change.

7 years agoReally commit some files that failed to get committed in this commit:
Ingo Schwarze [Thu, 9 Mar 2017 15:33:40 +0000 (15:33 +0000)]
Really commit some files that failed to get committed in this commit:

Now that markdown output is tested for almost everything, test all
input files in -T markdown output mode by default and only mark
those files with SKIP_MARKDOWN that are not to be tested.
Much easier to read, and almost minus 40 lines of Makefile code.

7 years agoFix blunder in previous: we must keep the line parse buffer
Ingo Schwarze [Thu, 9 Mar 2017 15:29:35 +0000 (15:29 +0000)]
Fix blunder in previous:  we must keep the line parse buffer
consistent even when aborting the parsing of the line.  That buffer
is not our own, but owned and reused by mparse_buf_r(), read.c.
Returning without cleanup leaked memory and caused write overruns
of the old, typically much smaller buffer in mparse_buf_r().
Promptly noticed by tb@ with afl(1), using MALLOC_OPTIONS=C.

7 years agoNow that markdown output is tested for almost everything, test all
Ingo Schwarze [Wed, 8 Mar 2017 22:54:22 +0000 (22:54 +0000)]
Now that markdown output is tested for almost everything, test all
input files in -T markdown output mode by default and only mark
those files with SKIP_MARKDOWN that are not to be tested.
Much easier to read, and almost minus 40 lines of Makefile code.

7 years agoDocument that -T markdown produces ASCII output, and the implied
Ingo Schwarze [Wed, 8 Mar 2017 19:40:59 +0000 (19:40 +0000)]
Document that -T markdown produces ASCII output, and the implied
limitations.  Of course, we could write UTF-8 output instead,
but even the CommonMark specification doesn't require parsers
to support that, so portability would be doubtful.

While here, provide a link to the CommonMark specification.

7 years agoThe CommonMark specification wants that opening parentheses
Ingo Schwarze [Wed, 8 Mar 2017 19:23:43 +0000 (19:23 +0000)]
The CommonMark specification wants that opening parentheses
inside link destinations be escaped.
While here, remove the obsolete ESC_PAR.

7 years agoAccording to the CommonMark specification, backslash escapes
Ingo Schwarze [Wed, 8 Mar 2017 18:17:21 +0000 (18:17 +0000)]
According to the CommonMark specification, backslash escapes
and markdown markup do not work inside code spans.

7 years agoThe CommonMark specification allows list markers fo the form "number) "
Ingo Schwarze [Wed, 8 Mar 2017 17:51:58 +0000 (17:51 +0000)]
The CommonMark specification allows list markers fo the form "number) "
as well as "number. ", so escape closing parentheses after leading digits
to improve portability.

7 years agoDo not increment .Bl -enum list markers beyond two digits.
Ingo Schwarze [Wed, 8 Mar 2017 17:40:55 +0000 (17:40 +0000)]
Do not increment .Bl -enum list markers beyond two digits.
Otherwise, we would indent subsequent paragraphs less than
the CommonMark specification requires, harming portability.

7 years ago.Bl -column never gets blank lines between rows
Ingo Schwarze [Wed, 8 Mar 2017 15:08:36 +0000 (15:08 +0000)]
.Bl -column never gets blank lines between rows

7 years agoadd two result files that were forgotten
Ingo Schwarze [Wed, 8 Mar 2017 14:51:40 +0000 (14:51 +0000)]
add two result files that were forgotten

7 years agoenable -T markdown tests of filled displays and tagged lists
Ingo Schwarze [Wed, 8 Mar 2017 14:45:55 +0000 (14:45 +0000)]
enable -T markdown tests of filled displays and tagged lists

7 years agoAdd a blank after ">" when quoting.
Ingo Schwarze [Wed, 8 Mar 2017 14:30:06 +0000 (14:30 +0000)]
Add a blank after ">" when quoting.
If is allowed by markdown syntax and more human-readable.

7 years agoprevent infinite recursion while expanding the arguments
Ingo Schwarze [Wed, 8 Mar 2017 13:18:10 +0000 (13:18 +0000)]
prevent infinite recursion while expanding the arguments
of a user-defined macro; issue found by tb@ with afl(1)

7 years agoIf a user-defined macro is aborted because it exceeds the stack
Ingo Schwarze [Tue, 7 Mar 2017 20:00:08 +0000 (20:00 +0000)]
If a user-defined macro is aborted because it exceeds the stack
limit, usually due to infinite recursion, discard whatever remains
in all those open stack levels.  Otherwise, insane constructions
like the following could generate macros of enormous size, causing
mandoc(1) to die from memory exhaustion:

.de m  \" original macro definition
.m     \" recursion to blow up the stack
.de m  \" definition to be run during the call of .m marked (*)
very long plain text (some kilobytes)
.m     \" expand the above a thousand times while unwinding the stack
..     \" end of the original definition
.m     \" (*) recursively generate a ridiculously large macro
..     \" end of recursively generated definition
.m     \" execute the giant macro, exhausting memory

Very creative abuse found by tb@ with afl(1).

7 years agoEscape blanks at the end of markdown lines
Ingo Schwarze [Tue, 7 Mar 2017 15:31:24 +0000 (15:31 +0000)]
Escape blanks at the end of markdown lines
such that they don't look like output line breaks.

7 years agofix completely empty .Eo: no blank line wanted
Ingo Schwarze [Tue, 7 Mar 2017 14:04:08 +0000 (14:04 +0000)]
fix completely empty .Eo: no blank line wanted

7 years agofix spacing after empty .Fl
Ingo Schwarze [Tue, 7 Mar 2017 13:28:02 +0000 (13:28 +0000)]
fix spacing after empty .Fl

7 years agoimplement .An -split and -nosplit
Ingo Schwarze [Tue, 7 Mar 2017 13:09:27 +0000 (13:09 +0000)]
implement .An -split and -nosplit

7 years agoFix .In formatting in the SYNOPSIS:
Ingo Schwarze [Tue, 7 Mar 2017 12:39:01 +0000 (12:39 +0000)]
Fix .In formatting in the SYNOPSIS:
No &zwnj; in the middle of **, please.

7 years agoUsing .Nd only makes sense in the NAME section.
Ingo Schwarze [Mon, 6 Mar 2017 17:26:04 +0000 (17:26 +0000)]
Using .Nd only makes sense in the NAME section.
Warn if that macro occurs elsewhere.
Triggered by a question from Dag-Erling Smoergrav <des @ FreeBSD>.

7 years agoURIs need different escaping; reported by reyk@
Ingo Schwarze [Mon, 6 Mar 2017 14:58:10 +0000 (14:58 +0000)]
URIs need different escaping; reported by reyk@

7 years agofirst batch of -T markdown tests
Ingo Schwarze [Sun, 5 Mar 2017 19:59:33 +0000 (19:59 +0000)]
first batch of -T markdown tests

7 years agoInfrastructure for -T markdown tests.
Ingo Schwarze [Sun, 5 Mar 2017 19:57:39 +0000 (19:57 +0000)]
Infrastructure for -T markdown tests.

This is needed because -T marksdown is expected to receive less
maintenance than -T ascii, so we need automation to make sure
that regular parser maintenance doesn't break this output mode.

7 years agoRemove a redundant condition in .%T handling, no functional change.
Ingo Schwarze [Sat, 4 Mar 2017 21:41:29 +0000 (21:41 +0000)]
Remove a redundant condition in .%T handling, no functional change.
Found by jsg@ with scan-build.

7 years agoMake the description of -K autodetection easer to understand.
Ingo Schwarze [Sat, 4 Mar 2017 17:17:34 +0000 (17:17 +0000)]
Make the description of -K autodetection easer to understand.
Basic idea suggested by jmc@, OK jmc@.

7 years agoDebian needs relative symlinks not only for manual pages,
Ingo Schwarze [Sat, 4 Mar 2017 16:36:29 +0000 (16:36 +0000)]
Debian needs relative symlinks not only for manual pages,
but also for program files.
Issue reported by Michael <Stapelberg at debian dot org>
and by Markus <Waldeck at gmx dot de>.

7 years agoMarkdown output mode helped us to find the first parser bug (as such,
Ingo Schwarze [Fri, 3 Mar 2017 15:05:48 +0000 (15:05 +0000)]
Markdown output mode helped us to find the first parser bug (as such,
this bug could cause wrong output in other modes as well):
Do not misinterpret tab characters as .Ta macros when they appear
on non-column .It lines in non-column .Bl lists that are nested
inside a parent .Bl -column list.  (Admittedly, such constructions
are not very useful; don't use them!)
Found by tb@ with afl(1) because the resulting tree corruption
triggered an assertion in the markdown output module.

7 years agonew -mdoc -Tmarkdown output mode; OK millert@ reyk@ tb@;
Ingo Schwarze [Fri, 3 Mar 2017 14:23:23 +0000 (14:23 +0000)]
new -mdoc -Tmarkdown output mode; OK millert@ reyk@ tb@;
thanks to reyk@ and to Vsevolod at FreeBSD for suggesting it

7 years agoremove a few redundant conditions that jsg@ found with cppcheck
Ingo Schwarze [Fri, 3 Mar 2017 13:55:31 +0000 (13:55 +0000)]
remove a few redundant conditions that jsg@ found with cppcheck

7 years agoFix a copy-and-paste error that caused man(7) manuals without
Ingo Schwarze [Fri, 3 Mar 2017 13:41:42 +0000 (13:41 +0000)]
Fix a copy-and-paste error that caused man(7) manuals without
a section number in .TH to be misinterpreted as preformatted.
Found by jsg@ with cppcheck.

7 years agoA missing initialization could randomly cause regular expression
Ingo Schwarze [Fri, 3 Mar 2017 13:11:21 +0000 (13:11 +0000)]
A missing initialization could randomly cause regular expression
searches to be case-insensitive that ought to be case sensitive.
Found by jsg@ with scan-build.

7 years agoFix previous: do not access the byte before the string if the string
Ingo Schwarze [Fri, 3 Mar 2017 11:50:49 +0000 (11:50 +0000)]
Fix previous: do not access the byte before the string if the string
is empty; found by jsg@ with afl(1).

7 years agoPledge man.cgi(8).
Ingo Schwarze [Wed, 22 Feb 2017 16:20:01 +0000 (16:20 +0000)]
Pledge man.cgi(8).
Based on a more complicated patch from semarie@.
Sebastien and tb@ both agree with the simplification.

7 years agoSince SQLite is gone, we no longer need the "flock" pledge.
Ingo Schwarze [Wed, 22 Feb 2017 14:58:48 +0000 (14:58 +0000)]
Since SQLite is gone, we no longer need the "flock" pledge.
Patch from semarie@, OK tb@.

7 years agoHandle an odd edge case where .It is preceded by .Sm.
Ingo Schwarze [Wed, 22 Feb 2017 08:54:41 +0000 (08:54 +0000)]
Handle an odd edge case where .It is preceded by .Sm.
NULL dereference in man.cgi reported by Gabriel Guzman <gabe at
guzman dash nunez dot com> on misc@.

7 years agoDebian wants relative, not absolute symlinks for man pages;
Ingo Schwarze [Wed, 22 Feb 2017 00:00:12 +0000 (00:00 +0000)]
Debian wants relative, not absolute symlinks for man pages;
suggested by Michael Stapelberg

7 years agofix spelling error;
Ingo Schwarze [Tue, 21 Feb 2017 23:44:43 +0000 (23:44 +0000)]
fix spelling error;
found by Michael <Stapelberg at debian dot org> with Lintian

7 years agorelease 1.14.1 VERSION_1_14_1
Ingo Schwarze [Tue, 21 Feb 2017 00:37:03 +0000 (00:37 +0000)]
release 1.14.1

7 years agoresolve trivial differences with OpenBSD:
Ingo Schwarze [Sat, 18 Feb 2017 17:29:28 +0000 (17:29 +0000)]
resolve trivial differences with OpenBSD:
* we include <sys/types.h> for size_t, so we don't need <stdint.h>
* sort declarations in read_whole_file()

7 years agoadd some regress targets
Ingo Schwarze [Sat, 18 Feb 2017 15:29:39 +0000 (15:29 +0000)]
add some regress targets

7 years agopreconv_encode() can take a const input buffer;
Ingo Schwarze [Sat, 18 Feb 2017 13:43:52 +0000 (13:43 +0000)]
preconv_encode() can take a const input buffer;
diff from <christos at NetBSD>

7 years agoProvide an uninstall target, to help cleaning up after installing
Ingo Schwarze [Sat, 18 Feb 2017 13:05:43 +0000 (13:05 +0000)]
Provide an uninstall target, to help cleaning up after installing
with the wrong DESTDIR.  Use with care.

7 years agoproper test for O_DIRECTORY
Ingo Schwarze [Sat, 18 Feb 2017 12:24:24 +0000 (12:24 +0000)]
proper test for O_DIRECTORY

7 years agodouble quotes were fixed, finally
Ingo Schwarze [Sat, 18 Feb 2017 11:53:33 +0000 (11:53 +0000)]
double quotes were fixed, finally

7 years agoUse typographic quotes rather than '"' for .Rs %T (no change for -Tascii
Ingo Schwarze [Fri, 17 Feb 2017 19:15:41 +0000 (19:15 +0000)]
Use typographic quotes rather than '"' for .Rs %T (no change for -Tascii
output, of course).  Patch from bentley@ in November 2014.  This can be
committed now because groff merged Anthony's patch yesterday.

7 years agoMany people have been complaining for a long time that ``...'' looks
Ingo Schwarze [Fri, 17 Feb 2017 18:28:06 +0000 (18:28 +0000)]
Many people have been complaining for a long time that ``...'' looks
ugly in -Tascii output.  For that reason, bentley@ submitted patches
to render "..." instead to groff in November 2014 (yes, more than
two years ago).  Carsten Kunze yesterday merged them for the upcoming
groff-1.22.4 release.  Yay!

Consequently, do the same in mandoc: Render \(Lq and \(Rq (which
are used for .Do, .Dq, .Lb, and .St) as '"' in -Tascii output.
All other output modes including -Tutf8 remain unchanged.

7 years agomore tests for .IP/.nf interaction that i forgot to commit
Ingo Schwarze [Fri, 17 Feb 2017 17:43:12 +0000 (17:43 +0000)]
more tests for .IP/.nf interaction that i forgot to commit

7 years agoNo need to cast NULL when assigning it to a variable;
Ingo Schwarze [Fri, 17 Feb 2017 14:45:55 +0000 (14:45 +0000)]
No need to cast NULL when assigning it to a variable;
from Christos Zoulas <christos at NetBSD>.

7 years agoImprove clarity of some casts;
Ingo Schwarze [Fri, 17 Feb 2017 14:43:54 +0000 (14:43 +0000)]
Improve clarity of some casts;
from Christos Zoulas <christos at NetBSD>.

7 years agoMake the directory explicit where source files are located.
Ingo Schwarze [Fri, 17 Feb 2017 14:40:28 +0000 (14:40 +0000)]
Make the directory explicit where source files are located.
This is simple and seems to help the NetBSD build infrastructure.
From Christos Zoulas <christos at NetBSD>.

7 years agoBe consistent in protecting __attribute__ attributes with __;
Ingo Schwarze [Fri, 17 Feb 2017 14:31:52 +0000 (14:31 +0000)]
Be consistent in protecting __attribute__ attributes with __;
from Christos Zoulas <christos @ NetBSD>.

7 years agoFix a read buffer overrun that copied random data from memory into
Ingo Schwarze [Fri, 17 Feb 2017 03:03:03 +0000 (03:03 +0000)]
Fix a read buffer overrun that copied random data from memory into
text nodes when a string passed to deroff() ended in a backslash
and the byte after the terminating NUL was non-NUL, found by tb@
with afl(1).

Invalid bytes so copied with the high bit set could later sometimes
trigger another out of bounds read access to static memory in
roff_strdup(), so add an assertion there to abort safely in case
of similar data corruption.

7 years agoadd $(LN) configuration variable; requested by Michael <Stapelberg@debian.org>
Ingo Schwarze [Thu, 16 Feb 2017 16:09:33 +0000 (16:09 +0000)]
add $(LN) configuration variable; requested by Michael <Stapelberg@debian.org>

7 years agofix previous: stupid typo
Ingo Schwarze [Thu, 16 Feb 2017 15:19:01 +0000 (15:19 +0000)]
fix previous: stupid typo

7 years agoProvide a variable BINM_CATMAN.
Ingo Schwarze [Thu, 16 Feb 2017 15:12:32 +0000 (15:12 +0000)]
Provide a variable BINM_CATMAN.
Suggested by Michael <Stapelberg@debian.org>.

7 years agoSurprisingly, groff does not support scaling units in .Bl -column
Ingo Schwarze [Thu, 16 Feb 2017 14:38:12 +0000 (14:38 +0000)]
Surprisingly, groff does not support scaling units in .Bl -column
column width specifiers, so stop supporting them, too.
As a side effect, this fixes an assertion failure that tb@ found
with afl(1), triggered by: .Bl -column -4n

7 years agoFix rev. 1.280: -O syntax is different in default apropos(1) output
Ingo Schwarze [Thu, 16 Feb 2017 10:56:07 +0000 (10:56 +0000)]
Fix rev. 1.280: -O syntax is different in default apropos(1) output
mode and in other output modes, so do not error out prematurely.
Also sort local variables in main() while here.

7 years agoFix block scoping error if an explicit block is broken by two
Ingo Schwarze [Thu, 16 Feb 2017 09:47:31 +0000 (09:47 +0000)]
Fix block scoping error if an explicit block is broken by two
implicit blocks (.Aq Bq Po .Pc) that left the outer breaker open
and could in exceptional cases, like between .Bl and .It, cause
tree corruption leading to NULL dereference.
Found by tb@ with afl(1).

While here, do not mark intermediate ENDBODY markers as broken.

7 years agoRemove the ENDBODY_NOSPACE flag, simplifying the code.
Ingo Schwarze [Thu, 16 Feb 2017 03:00:23 +0000 (03:00 +0000)]
Remove the ENDBODY_NOSPACE flag, simplifying the code.

Comparing to groff output, it appears that all cases where it was used
and made a difference actually require the opposite, ENDBODY_SPACE.

I have no idea why i added it back in 2010; maybe to compensate for
some other bug that has long been fixed.

7 years agoStyle improvement, no functional change.
Ingo Schwarze [Wed, 15 Feb 2017 15:58:46 +0000 (15:58 +0000)]
Style improvement, no functional change.

As reported by Yuri Pankov, some versions of GCC whine that "tmp"
might be used uninitialized in fts_open(3).  Clearly, that cannot
actually happen, but explicitly setting it to NULL is safer anyway.
While here, rename the badly named variable "tmp" and make the
inner "if" easier to understand.

Feedback and OK guenther@