]> git.cameronkatri.com Git - mandoc.git/log
mandoc.git
10 years agoBugfix: When the invocation of a user-defined macro follows a roff
Ingo Schwarze [Wed, 7 Jan 2015 12:19:46 +0000 (12:19 +0000)]
Bugfix: When the invocation of a user-defined macro follows a roff
conditional request on the same input line, don't skip the first few
bytes of its content.

10 years agoFix a potential NULL pointer access in an error message after waitpid()
Ingo Schwarze [Sat, 3 Jan 2015 12:55:25 +0000 (12:55 +0000)]
Fix a potential NULL pointer access in an error message after waitpid()
failure; found using detailed information provided by Ulrich Spoerlein
<uqs at FreeBSD> about FreeBSD Coverity CID 1261304.

10 years agoGiven the excessively technical description in the old mdoc_samples(7)
Ingo Schwarze [Sat, 3 Jan 2015 00:59:13 +0000 (00:59 +0000)]
Given the excessively technical description in the old mdoc_samples(7)
manual and its successor groff_mdoc(7), i always considered .Ql as
purely physical markup, but it turns out describing it better allows
to give it a semantic meaning (in-line literal display) that doesn't
contradict existing usage.  One less physical, one more semantic
macro, yay!

Found in a discussion with Steffen Nurpmeso <sdaoden at yandex dot com>.

10 years agoExplicitly set the *data member of struct ohash_info to NULL.
Ingo Schwarze [Fri, 2 Jan 2015 17:02:19 +0000 (17:02 +0000)]
Explicitly set the *data member of struct ohash_info to NULL.
It is never dereferenced, but it gets copied around, which worries
static analysis tools and might also confuse human auditors.
FreeBSD Coverity CID 126129812612991261300, reported by
Pedro Giffuni and Ulrich Spörlein <pfg@ and uqs@ at FreeBSD>.

10 years agoFix a buffer overrun triggered by a trailing backslash at EOF in
Ingo Schwarze [Thu, 1 Jan 2015 19:28:49 +0000 (19:28 +0000)]
Fix a buffer overrun triggered by a trailing backslash at EOF in
an unclosed conditional body.  If the memory contained the byte
sequence "\}" after the end of the buffer before the next NUL, this
could even write beyond the end of the buffer, specifically '&' to
the location of the '}'.  Found by jsg@ with afl.

10 years agoFix a read buffer overrun triggered by trailing \s- or trailing \s+
Ingo Schwarze [Thu, 1 Jan 2015 18:11:45 +0000 (18:11 +0000)]
Fix a read buffer overrun triggered by trailing \s- or trailing \s+
without the required subsequent argument; found by jsg@ with afl.

10 years agoDon't dereference NULL pointers when formatting missing denominators,
Ingo Schwarze [Thu, 1 Jan 2015 15:36:08 +0000 (15:36 +0000)]
Don't dereference NULL pointers when formatting missing denominators,
subscripts, superscripts, or "from" or "to" arguments.
Found by jsg@ with afl.

10 years agoIf man(1) only has one single argument, always interpret it as a name,
Ingo Schwarze [Thu, 1 Jan 2015 13:20:38 +0000 (13:20 +0000)]
If man(1) only has one single argument, always interpret it as a name,
never as a section.  Who would have thought that people call their
manual pages 7z(1), 9c(1), 9p(1), and 9p(3)...
Patch from Sebastien Marie <semarie dash openbsd at latrappe dot fr>.

10 years agodescribe .Ql more precisely;
Ingo Schwarze [Wed, 31 Dec 2014 20:42:31 +0000 (20:42 +0000)]
describe .Ql more precisely;
defect pointed out by Steffen Nurpmeso <sdaoden at yandex dot com>

10 years agoWhen showing more than one formatted manual page, insert horizontal lines
Ingo Schwarze [Wed, 31 Dec 2014 16:52:39 +0000 (16:52 +0000)]
When showing more than one formatted manual page, insert horizontal lines
between pages.  Suggested by Theo Buehler <theo at math dot ethz dot ch>.
Even in UTF-8 output mode, do not use fancy line drawing characters such
that you can easily use /^--- to skip to the next manual in your pager.

10 years agofix wrong paths below FILES; from Theo Buehler <theo at math dot ethz dot ch>
Ingo Schwarze [Tue, 30 Dec 2014 21:34:57 +0000 (21:34 +0000)]
fix wrong paths below FILES; from Theo Buehler <theo at math dot ethz dot ch>

10 years agoWhen a file is given on the command line, actually exists, and its name
Ingo Schwarze [Tue, 30 Dec 2014 20:41:00 +0000 (20:41 +0000)]
When a file is given on the command line, actually exists, and its name
relative to the respective manual tree is longer than PATH_MAX, do not
leak the memory allocated to hold the name.  Not sure that can actually
happen, but better safe than sorry.
FreeBSD Coverity Scan CID 1261303, reported by Pedro Giffuni <pfg@>.

10 years agoImprove documentation of the header/footer macros .Dt, .Os, .TH:
Ingo Schwarze [Sun, 28 Dec 2014 15:23:33 +0000 (15:23 +0000)]
Improve documentation of the header/footer macros .Dt, .Os, .TH:
* State the defaults for .Os and the fourth .TH argument.
* Sync the section titles, and stop advertising obscure sections that
aren't actually fully supported and certainly not recommended for use.

10 years agomdoc(7) already uses the mandoc(1) -Ios argument in the footer line
Ingo Schwarze [Sun, 28 Dec 2014 14:42:27 +0000 (14:42 +0000)]
mdoc(7) already uses the mandoc(1) -Ios argument in the footer line
when .Os has no argument, so do the same for man(7) when .TH has less
than four arguments; there is no reason to treat both differently.
Issue found following a question from Thomas Klausner <wiz at NetBSD>.

10 years agoimprove previous: do the size check up front to avoid leaking memory
Ingo Schwarze [Sun, 28 Dec 2014 14:16:26 +0000 (14:16 +0000)]
improve previous: do the size check up front to avoid leaking memory

10 years agoReduce memory and time consumption on certain malformed input files
Ingo Schwarze [Thu, 25 Dec 2014 17:23:32 +0000 (17:23 +0000)]
Reduce memory and time consumption on certain malformed input files
by limiting the length of expanded input lines during the
(usually recursive) expansion of user defined strings.
Resource hogging found by jsg@ with afl.

10 years agoSupport negative indentations for mdoc(7) displays and lists.
Ingo Schwarze [Wed, 24 Dec 2014 23:32:42 +0000 (23:32 +0000)]
Support negative indentations for mdoc(7) displays and lists.
Not exactly recommended for use, rather for groff compatibility.
While here, introduce similar SHRT_MAX limits as in man(7),
fixing a few cases of infinite output found by jsg@ with afl.

10 years agoFor .RS, we need to save the information how much we actually indented
Ingo Schwarze [Wed, 24 Dec 2014 18:04:10 +0000 (18:04 +0000)]
For .RS, we need to save the information how much we actually indented
because negative indents can get truncated, in which case we no longer
know how to restore the original indent at the end of the block.
This also solves another case of effectively infinite output found
by jsg@ with afl, triggered by very large negative indents.

10 years agoPrevent unsigned integer underflow when a number is too wide
Ingo Schwarze [Wed, 24 Dec 2014 15:38:55 +0000 (15:38 +0000)]
Prevent unsigned integer underflow when a number is too wide
for a table cell with an "nz" layout specification,
causing essentially infinite output as found by jsg@ with afl.

10 years agoWhen a man(7) document contains unreasonably large numbers for
Ingo Schwarze [Wed, 24 Dec 2014 09:58:35 +0000 (09:58 +0000)]
When a man(7) document contains unreasonably large numbers for
indentations or paragraph distances, large output may be generated,
which is practically the same as an endless loop; found by jsg@
with afl.
Reject such unreasonably large numbers beyond arbitrary limits
similar to those used by groff (max. 65 blank lines between paragraphs
and max. SHRT_MAX characters per output line) and fall back to
defaults when exceeded.  Having the limits behave in exactly the
same way is not relevant.

10 years agosupport negative horizontal widths in man(7);
Ingo Schwarze [Tue, 23 Dec 2014 13:48:57 +0000 (13:48 +0000)]
support negative horizontal widths in man(7);
minus twenty lines of code in spite of enhanced functionality

10 years agofix typo in previous
Ingo Schwarze [Tue, 23 Dec 2014 10:09:44 +0000 (10:09 +0000)]
fix typo in previous

10 years agosome scaling unit fixes:
Ingo Schwarze [Tue, 23 Dec 2014 09:31:46 +0000 (09:31 +0000)]
some scaling unit fixes:
- .sp with an invalid argument is .sp 1v, not .sp 0v
- in man(1), trailing garbage doesn't make scaling units invalid

10 years agoeven if the second argument to .IP is invalid, don't print it
Ingo Schwarze [Tue, 23 Dec 2014 08:15:53 +0000 (08:15 +0000)]
even if the second argument to .IP is invalid, don't print it

10 years agoFix vertical scaling. Obviously, nobody ever had a serious look at this.
Ingo Schwarze [Tue, 23 Dec 2014 06:16:46 +0000 (06:16 +0000)]
Fix vertical scaling.  Obviously, nobody ever had a serious look at this.
Basic units, centimeters, points, ens, ems, and the rounding algorithm
were all wrong, only inches, pica, and the default vertical span worked.

10 years agoIn a2roffsu(), do not parse the number twice.
Ingo Schwarze [Tue, 23 Dec 2014 03:28:01 +0000 (03:28 +0000)]
In a2roffsu(), do not parse the number twice.
Gets rid of 25 lines of code and one static buffer.
No functional change for numbers shorter than BUFSIZ characters.

10 years agocorrectly handle scaling units after .PD
Ingo Schwarze [Tue, 23 Dec 2014 01:57:35 +0000 (01:57 +0000)]
correctly handle scaling units after .PD

10 years agoThe code already pays attention not to close the same block twice.
Ingo Schwarze [Mon, 22 Dec 2014 23:27:32 +0000 (23:27 +0000)]
The code already pays attention not to close the same block twice.
Similarly, avoid having the same block break two other blocks.
In some situations, this could lead to an endless loop in rew_sub()
found by jsg@ with afl.
Minimal example:  .Po Ao Pc Bo Pc Ac Bc

10 years agoUse -m for macro set selection in mandoc(1) mode only, not in man(1)
Ingo Schwarze [Sun, 21 Dec 2014 14:49:28 +0000 (14:49 +0000)]
Use -m for macro set selection in mandoc(1) mode only, not in man(1)
and apropos(1) mode.  While here, put a space character between
options and option arguments in error messages.
Both reported by Alessandro DE LAURENZIS <just22 dot adl at gmail dot com>.

10 years agoISO C99 explicitly forbids forward references to enum types (6.7.2.3.3.);
Ingo Schwarze [Sun, 21 Dec 2014 14:14:35 +0000 (14:14 +0000)]
ISO C99 explicitly forbids forward references to enum types (6.7.2.3.3.);
patch from daniel@

10 years agoFix two issues causing a class of assertion failures found by jsg@ with afl.
Ingo Schwarze [Sat, 20 Dec 2014 02:26:57 +0000 (02:26 +0000)]
Fix two issues causing a class of assertion failures found by jsg@ with afl.
1) rew_sub(): Make sure REWIND_MORE is acted upon even when followed by
REWIND_NONE.  This prevents .It from ending up inside other children of .Bl.
2) blk_exp_close(): Only allow extension of .Bl when it has at least
one .It.  Otherwise, a broken child block could be moved in front of
the .Bl, effectively resulting in a .Bl that ended before it began.

10 years agoresolve some code duplication; no functional change
Ingo Schwarze [Sat, 20 Dec 2014 00:20:11 +0000 (00:20 +0000)]
resolve some code duplication; no functional change

10 years agoEnforcing an arbitrary, implementation dependent, undocumented limit
Ingo Schwarze [Fri, 19 Dec 2014 17:12:04 +0000 (17:12 +0000)]
Enforcing an arbitrary, implementation dependent, undocumented limit
by calling assert() when valid user input exceeds it is a bad idea.
Allocate the terminal font stack dynamically instead of crashing
above 10 entries.  Issue found by jsg@ with afl.

10 years agoRewrite the low-level UTF-8 parser from scratch.
Ingo Schwarze [Fri, 19 Dec 2014 04:58:35 +0000 (04:58 +0000)]
Rewrite the low-level UTF-8 parser from scratch.
It accepted invalid byte sequences like 0xc080-c1bf, 0xe08080-e09fbf,
0xeda080-edbfbf, and 0xf0808080-f08fbfbf, produced valid roff Unicode
escape sequences from them, and the algorithm contained strong
defenses against any attempt to fix it.

This cures an assertion failure in the terminal formatter caused
by sneaking in ASCII 0x08 (backspace) by "encoding" it as an (invalid)
multibyte UTF-8 sequence, found by jsg@ with afl.

As a bonus, the new algorithm also reduces the code in the function
by about 20%.

10 years agoupdate usage() and the list of non-standard (i.e. non-posix) options;
Ingo Schwarze [Thu, 18 Dec 2014 21:11:46 +0000 (21:11 +0000)]
update usage() and the list of non-standard (i.e. non-posix) options;
from jmc@

10 years agoDon't let .Ta creep into an already-closed list; same as for .It.
Ingo Schwarze [Thu, 18 Dec 2014 20:58:32 +0000 (20:58 +0000)]
Don't let .Ta creep into an already-closed list; same as for .It.
Fixes an assertion found by jsg@ with afl.

10 years agoOnly keep leading .Sm inside a list when it immediately precedes
Ingo Schwarze [Thu, 18 Dec 2014 20:15:56 +0000 (20:15 +0000)]
Only keep leading .Sm inside a list when it immediately precedes
the first .It.  Otherwise, move it out together with whatever
follows.  Fixing an assertion failure found by jsg@ with afl.

10 years agoWhen the head of a list item is extended with a partial explicit
Ingo Schwarze [Thu, 18 Dec 2014 19:23:41 +0000 (19:23 +0000)]
When the head of a list item is extended with a partial explicit
macro (for example .Xo) and never closed again, the item ends up
without a body block.  This can even happen for list types that
usually don't have heads in the first place.  So even in this
case, check for the existence of the body before accessing it.
NULL pointer access found by jsg@ with afl.

10 years agoDon't let the modulo operator divide by zero.
Ingo Schwarze [Thu, 18 Dec 2014 17:43:41 +0000 (17:43 +0000)]
Don't let the modulo operator divide by zero.
Found by jsg@ with afl.

10 years agoThe code is already careful to not add items to lists that were
Ingo Schwarze [Thu, 18 Dec 2014 03:10:11 +0000 (03:10 +0000)]
The code is already careful to not add items to lists that were
already closed.  In this respect, also consider lists closed
that have broken another block, their closure pending until the
end of the broken block.  This avoids syntax tree corruption
leading to a NULL pointer access found by jsg@ with afl.

10 years ago[[:<:]] is not POSIX
Ingo Schwarze [Wed, 17 Dec 2014 20:31:19 +0000 (20:31 +0000)]
[[:<:]] is not POSIX

10 years agominimally document -IOKTW; requested by naddy@
Ingo Schwarze [Wed, 17 Dec 2014 20:04:23 +0000 (20:04 +0000)]
minimally document -IOKTW; requested by naddy@

10 years agoBe a bit more lenient in what to accept for section names given
Ingo Schwarze [Wed, 17 Dec 2014 18:45:35 +0000 (18:45 +0000)]
Be a bit more lenient in what to accept for section names given
as the first man(1) command line argument without -s:
Accept digits like "1", "2"; digit+letter like "3p", "1X"; and "n".
Issue reported by Svyatoslav Mishyn <juef at openmailbox dot org> (Crux Linux).

10 years agoIgnore mdoc(7) and man(7) macros inside tbl(7) code because they
Ingo Schwarze [Tue, 16 Dec 2014 23:44:41 +0000 (23:44 +0000)]
Ignore mdoc(7) and man(7) macros inside tbl(7) code because they
would abort the table in an unclean way, causing assertion failures
found by jsg@.

10 years agocorrect -Tutf8 and -Thtml rendering of \(~=
Ingo Schwarze [Tue, 16 Dec 2014 19:50:03 +0000 (19:50 +0000)]
correct -Tutf8 and -Thtml rendering of \(~=
and change the name of \(-~ to \(|= to agree with groff;
difference found by Carsten dot Kunze at arcor dot de

10 years agoExplicit block closure macros clobber next-line block head scope,
Ingo Schwarze [Tue, 16 Dec 2014 17:26:00 +0000 (17:26 +0000)]
Explicit block closure macros clobber next-line block head scope,
just like explicit block macros themselves.
Fixing an assertion failure jsg@ found with afl.

10 years agoWhen a string comparison condition contains no mismatching character
Ingo Schwarze [Tue, 16 Dec 2014 03:53:43 +0000 (03:53 +0000)]
When a string comparison condition contains no mismatching character
but ends without the final delimiter, the parse point was advanced
one character too far and the invalid pointer returned to the
caller of roff_parseln().  Later use could potentially advance
the pointer even further and maybe even write to it.
Fixing a buffer overrun found by jsg@ with afl (the most severe so far).

10 years agoWhen a numerical condition errors out after consuming at least one
Ingo Schwarze [Tue, 16 Dec 2014 01:22:59 +0000 (01:22 +0000)]
When a numerical condition errors out after consuming at least one
character of input, treat it as false, do not retry it as a string
comparison condition.  This also fixes a read buffer overrun that
happened when the numerical condition advanced to the end of the
input line before erroring out, found by jsg@ with afl.

10 years agoEmpty conditions count as false.
Ingo Schwarze [Mon, 15 Dec 2014 23:43:26 +0000 (23:43 +0000)]
Empty conditions count as false.
When negated, they still count as false.
Found when investigating crashes jsg@ found with afl.
Not completely fixing the crashes yet.

10 years agocorrect some character names to match groff;
Ingo Schwarze [Mon, 15 Dec 2014 19:42:21 +0000 (19:42 +0000)]
correct some character names to match groff;
reported by Carsten dot Kunze at arcor dot de

10 years agoLet "man n open" do the same as "man -s n open" again, that is,
Ingo Schwarze [Mon, 15 Dec 2014 18:05:57 +0000 (18:05 +0000)]
Let "man n open" do the same as "man -s n open" again, that is,
show the open(n) Tcl manual, as documented in man(1).  Issue reported
by Svyatoslav Mishyn <juef at openmailbox dot org> (Crux Linux).

10 years agoCatch localtime() failure for additional safety;
Ingo Schwarze [Mon, 15 Dec 2014 17:30:30 +0000 (17:30 +0000)]
Catch localtime() failure for additional safety;
patch from Jan Stary <hans at stare dot cz> some time ago.

10 years agoversion 1.13.2 VERSION_1_13_2
Ingo Schwarze [Sat, 13 Dec 2014 13:43:47 +0000 (13:43 +0000)]
version 1.13.2

10 years agoFix a regression found by Carsten dot Kunze at arcor dot de:
Ingo Schwarze [Sat, 13 Dec 2014 13:14:39 +0000 (13:14 +0000)]
Fix a regression found by Carsten dot Kunze at arcor dot de:
Do not show bogus quotes when .Bl -column phrases are quoted.

10 years agoescape Nd on a macro line
Ingo Schwarze [Fri, 12 Dec 2014 21:44:33 +0000 (21:44 +0000)]
escape Nd on a macro line

10 years agoGuard some come needed for database support only by #if HAVE_SQLITE3.
Ingo Schwarze [Thu, 11 Dec 2014 19:19:35 +0000 (19:19 +0000)]
Guard some come needed for database support only by #if HAVE_SQLITE3.
Compiler warnings about unused code reported by wiz@NetBSD.

10 years agoMake this work on illumos:
Ingo Schwarze [Thu, 11 Dec 2014 18:20:07 +0000 (18:20 +0000)]
Make this work on illumos:
* define MAX()
* ignore O_DIRECTORY if it isn't defined
* garbage collect two unused variables
Issues reported and fix tested by wiz@NetBSD.

10 years agofix RCS IDs
Ingo Schwarze [Thu, 11 Dec 2014 09:19:32 +0000 (09:19 +0000)]
fix RCS IDs

10 years agosync to OpenBSD
Ingo Schwarze [Thu, 11 Dec 2014 09:05:01 +0000 (09:05 +0000)]
sync to OpenBSD

10 years agonew Copyright years
Ingo Schwarze [Thu, 11 Dec 2014 07:56:24 +0000 (07:56 +0000)]
new Copyright years

10 years agolink to EuroBSDCon 2014
Ingo Schwarze [Thu, 11 Dec 2014 07:44:46 +0000 (07:44 +0000)]
link to EuroBSDCon 2014

10 years agocorrectly align document header and footer;
Ingo Schwarze [Wed, 10 Dec 2014 22:19:45 +0000 (22:19 +0000)]
correctly align document header and footer;
suggested by kristaps@

10 years agothe asciidoc/docbook toolchain uses braindead \h for indentation
Ingo Schwarze [Wed, 10 Dec 2014 21:54:13 +0000 (21:54 +0000)]
the asciidoc/docbook toolchain uses braindead \h for indentation

10 years agomore release preparations
Ingo Schwarze [Tue, 9 Dec 2014 12:05:44 +0000 (12:05 +0000)]
more release preparations

10 years agofirst cut at updating for the next release
Ingo Schwarze [Tue, 9 Dec 2014 09:19:13 +0000 (09:19 +0000)]
first cut at updating for the next release

10 years agoSupport choosing alternative binary and manual names from configure.local,
Ingo Schwarze [Tue, 9 Dec 2014 09:14:33 +0000 (09:14 +0000)]
Support choosing alternative binary and manual names from configure.local,
to help downstream distributions avoid naming conflicts.

10 years agoIntegrate the makewhatis binary into the mandoc binary
Ingo Schwarze [Tue, 9 Dec 2014 07:29:42 +0000 (07:29 +0000)]
Integrate the makewhatis binary into the mandoc binary
just like we do it on OpenBSD.  Smaller and neater.
While here, let ./configure set INSTALL_TARGETS.

10 years agoSome sorting and some more comments.
Ingo Schwarze [Tue, 9 Dec 2014 06:31:03 +0000 (06:31 +0000)]
Some sorting and some more comments.
Drop DISTDIR from www-install target.

10 years agoInstall "man" as a hardlink to "mandoc" during db-install.
Ingo Schwarze [Tue, 9 Dec 2014 06:11:35 +0000 (06:11 +0000)]
Install "man" as a hardlink to "mandoc" during db-install.
Install man(1) manual in db-install, not base-install.
Get rid of the useless variables BASEBIN, DBBIN, CGIBIN.

10 years agoWhen opening mandoc.db fails, tell the user in which directory.
Ingo Schwarze [Sat, 6 Dec 2014 01:23:24 +0000 (01:23 +0000)]
When opening mandoc.db fails, tell the user in which directory.
Improving an unhelpful error message reported by millert@.

10 years agoimplement help(1)
Ingo Schwarze [Fri, 5 Dec 2014 21:55:04 +0000 (21:55 +0000)]
implement help(1)

10 years agoImprove parsing of function names.
Ingo Schwarze [Fri, 5 Dec 2014 16:18:14 +0000 (16:18 +0000)]
Improve parsing of function names.
This gets rid of the last bogus entries in base and Xenocara.

10 years agoDo not misinterpret function arguments as function names;
Ingo Schwarze [Fri, 5 Dec 2014 15:16:54 +0000 (15:16 +0000)]
Do not misinterpret function arguments as function names;
improves semantic analysis of more than 300 manuals.

10 years agoRender text before, not after accumulating flag bits, such that flags
Ingo Schwarze [Fri, 5 Dec 2014 14:26:40 +0000 (14:26 +0000)]
Render text before, not after accumulating flag bits, such that flags
for different representations of the same string end up in the same
database entry.  Improves name classification for 500 manuals.

10 years agoWhen finding a .so link after the page was already processed,
Ingo Schwarze [Thu, 4 Dec 2014 21:48:48 +0000 (21:48 +0000)]
When finding a .so link after the page was already processed,
do not clobber the existing names flags;
instead, OR the additional flags into them.

10 years agocorrectly store .Dt and .TH information in the names table
Ingo Schwarze [Thu, 4 Dec 2014 20:13:25 +0000 (20:13 +0000)]
correctly store .Dt and .TH information in the names table

10 years agoin the SYNOPSIS, add .Fo and first .Fn arguments to the names table
Ingo Schwarze [Thu, 4 Dec 2014 18:31:20 +0000 (18:31 +0000)]
in the SYNOPSIS, add .Fo and first .Fn arguments to the names table

10 years agoIn the SYNOPSIS, if .Nm occurs without argument, give the first .Nm
Ingo Schwarze [Thu, 4 Dec 2014 17:36:00 +0000 (17:36 +0000)]
In the SYNOPSIS, if .Nm occurs without argument, give the first .Nm
that occurred in the document a NAME_SYN entry in the names table.

10 years agofix handling of roff requests having a default scale other than "n",
Ingo Schwarze [Thu, 4 Dec 2014 02:05:42 +0000 (02:05 +0000)]
fix handling of roff requests having a default scale other than "n",
in particular .sp which uses "v", when the scale is not specified;
cures groff-mandoc differences in about a dozen Xenocara manuals

10 years agoIgnore macros that never produce any text when deciding whether
Ingo Schwarze [Thu, 4 Dec 2014 01:33:42 +0000 (01:33 +0000)]
Ignore macros that never produce any text when deciding whether
vertical whitespace is needed before a section or subsection.
Cures groff-mandoc differences in more than 300 manuals,
mostly Xenocara, some curses, a few GNU.

10 years agodelete five entries that were already fixed
Ingo Schwarze [Wed, 3 Dec 2014 01:46:54 +0000 (01:46 +0000)]
delete five entries that were already fixed

10 years agoSwitch the default output mode from -Tascii to -Tlocale.
Ingo Schwarze [Tue, 2 Dec 2014 11:31:51 +0000 (11:31 +0000)]
Switch the default output mode from -Tascii to -Tlocale.
This doesn't change anything unless LC_CTYPE is set,
but it helps when running with LC_TYPE=something.UTF-8.

OK tedu@  and earlier positive feedback from:
bentley@ deraadt@ naddy@ stsp@  uqs@freebsd wiz@netbsd

10 years agonote to self to not forget about groff
Ingo Schwarze [Tue, 2 Dec 2014 11:13:49 +0000 (11:13 +0000)]
note to self to not forget about groff

10 years agowe really need .ta
Ingo Schwarze [Tue, 2 Dec 2014 10:41:12 +0000 (10:41 +0000)]
we really need .ta

10 years agoFix the implementation and documentation of \c (continue text input line).
Ingo Schwarze [Tue, 2 Dec 2014 10:08:06 +0000 (10:08 +0000)]
Fix the implementation and documentation of \c (continue text input line).
In particular, make it work in no-fill mode, too.
Reminded by Carsten dot Kunze at arcor dot de (Heirloom roff).

10 years agodeveloper documentation regarding header files
Ingo Schwarze [Mon, 1 Dec 2014 08:09:26 +0000 (08:09 +0000)]
developer documentation regarding header files

10 years agoheader cleanup:
Ingo Schwarze [Mon, 1 Dec 2014 08:05:52 +0000 (08:05 +0000)]
header cleanup:
* add missing forward declarations
* remove needless header inclusions
* some style unification

10 years agoThe header libmandoc.h is part of the internal parser interface,
Ingo Schwarze [Mon, 1 Dec 2014 04:34:06 +0000 (04:34 +0000)]
The header libmandoc.h is part of the internal parser interface,
but html.c is not part of the parser at all, so it cannot include
that header, and actually, it doesn't need it.
Found while auditing includes after Theo's recent *.h commit.

10 years agoThe file read.c is part of the parser, so it cannot include main.h,
Ingo Schwarze [Mon, 1 Dec 2014 04:14:14 +0000 (04:14 +0000)]
The file read.c is part of the parser, so it cannot include main.h,
which is not part of the parser.  Besides, the parser *does* modify
the input buffer, so marking it "const" in the mparse_readmem()
interface is an outright lie.  Fix all this by killing the const,
the UNCONST, and the bogus inclusion.

10 years agoremove unneccessary inclusion protection; patch from deraadt@
Ingo Schwarze [Mon, 1 Dec 2014 04:05:31 +0000 (04:05 +0000)]
remove unneccessary inclusion protection; patch from deraadt@

10 years agotypo; Svyatoslav Mishyn <juef at openmailbox dot org> (Crux Linux)
Ingo Schwarze [Sun, 30 Nov 2014 22:47:16 +0000 (22:47 +0000)]
typo; Svyatoslav Mishyn <juef at openmailbox dot org> (Crux Linux)

10 years agodelete three standard abbreviations that are
Ingo Schwarze [Sun, 30 Nov 2014 21:56:18 +0000 (21:56 +0000)]
delete three standard abbreviations that are
* no longer used in OpenBSD
* not used in any of NetBSD, FreeBSD, or DragonFly
* not supported by groff

10 years agoMultiple fixes with respect to .Pf:
Ingo Schwarze [Sun, 30 Nov 2014 05:29:00 +0000 (05:29 +0000)]
Multiple fixes with respect to .Pf:
* The first argument of .Pf is not parsed.
* Normal delimiter handling does not apply to the first argument of .Pf.
* Warn if nothing follows a prefix (inspired by groff_mdoc(7)).
* In that case, do not suppress spacing.

10 years agowarn about attempts to call non-callable macros;
Ingo Schwarze [Sun, 30 Nov 2014 02:36:38 +0000 (02:36 +0000)]
warn about attempts to call non-callable macros;
inspired by a similar warning in the groff_mdoc(7) macros

10 years agoReduce code duplication by reusing the same argument parser
Ingo Schwarze [Sat, 29 Nov 2014 04:31:35 +0000 (04:31 +0000)]
Reduce code duplication by reusing the same argument parser
for in_line_eoln() macros and .Bl -column phrases.
No functional change.

10 years agoProvide a helper function macro_or_word() and use it to prune the
Ingo Schwarze [Sat, 29 Nov 2014 03:37:44 +0000 (03:37 +0000)]
Provide a helper function macro_or_word() and use it to prune the
same chunk of argument parsing code out of five of the eight callback
functions.  The other three have too much special handling to
participate.
As a bonus, let lookup() and mdoc_args() deal with line macros and
retire the lookup_raw() helper and the mdoc_zargs() internal interface
function.
No functional change, minus 40 lines of code.

10 years agoFold the loop around mdoc_argv() into the function itself,
Ingo Schwarze [Fri, 28 Nov 2014 23:21:32 +0000 (23:21 +0000)]
Fold the loop around mdoc_argv() into the function itself,
it was the same in all four cases.  As a bonus, get rid
of one enum type that was used for internal communication.
No functional change, minus 40 lines of code.

10 years agoAT&T is unlikely to release an new version of Research UNIX any time soon.
Ingo Schwarze [Fri, 28 Nov 2014 18:57:31 +0000 (18:57 +0000)]
AT&T is unlikely to release an new version of Research UNIX any time soon.
So, it's pointless to make adding version strings easy for downstream.
One source file less to maintain.

10 years agoRetire support for CSRG supplementary document titles. These are
Ingo Schwarze [Fri, 28 Nov 2014 18:36:35 +0000 (18:36 +0000)]
Retire support for CSRG supplementary document titles.  These are
long obsolete and were never written in mdoc(7) in the first place.
Removes 100 lines from source files.

10 years agoDrop useless architecture table. Validating architecture names
Ingo Schwarze [Fri, 28 Nov 2014 18:09:01 +0000 (18:09 +0000)]
Drop useless architecture table.  Validating architecture names
is a job for makewhatis(8)/mandoc.db(5), not for the parser.
Removes 150 lines from source files and 4k (1%) from the binary.
Bloat found by deraadt@.