aboutsummaryrefslogtreecommitdiffstatshomepage
Commit message (Collapse)AuthorAgeFilesLines
* Enforcing an arbitrary, implementation dependent, undocumented limitIngo Schwarze2014-12-194-22/+32
| | | | | | 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.
* Rewrite the low-level UTF-8 parser from scratch.Ingo Schwarze2014-12-191-76/+59
| | | | | | | | | | | | | | 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%.
* update usage() and the list of non-standard (i.e. non-posix) options;Ingo Schwarze2014-12-182-6/+8
| | | | from jmc@
* Don't let .Ta creep into an already-closed list; same as for .It.Ingo Schwarze2014-12-181-2/+3
| | | | Fixes an assertion found by jsg@ with afl.
* Only keep leading .Sm inside a list when it immediately precedesIngo Schwarze2014-12-181-2/+5
| | | | | the first .It. Otherwise, move it out together with whatever follows. Fixing an assertion failure found by jsg@ with afl.
* When the head of a list item is extended with a partial explicitIngo Schwarze2014-12-181-7/+7
| | | | | | | | 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.
* Don't let the modulo operator divide by zero.Ingo Schwarze2014-12-181-2/+8
| | | | Found by jsg@ with afl.
* The code is already careful to not add items to lists that wereIngo Schwarze2014-12-182-22/+34
| | | | | | | 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.
* [[:<:]] is not POSIXIngo Schwarze2014-12-171-1/+5
|
* minimally document -IOKTW; requested by naddy@Ingo Schwarze2014-12-171-10/+67
|
* Be a bit more lenient in what to accept for section names givenIngo Schwarze2014-12-171-6/+7
| | | | | | 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).
* Ignore mdoc(7) and man(7) macros inside tbl(7) code because theyIngo Schwarze2014-12-164-9/+27
| | | | | would abort the table in an unclean way, causing assertion failures found by jsg@.
* correct -Tutf8 and -Thtml rendering of \(~=Ingo Schwarze2014-12-162-10/+10
| | | | | and change the name of \(-~ to \(|= to agree with groff; difference found by Carsten dot Kunze at arcor dot de
* Explicit block closure macros clobber next-line block head scope,Ingo Schwarze2014-12-161-3/+3
| | | | | just like explicit block macros themselves. Fixing an assertion failure jsg@ found with afl.
* When a string comparison condition contains no mismatching characterIngo Schwarze2014-12-161-2/+2
| | | | | | | | 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).
* When a numerical condition errors out after consuming at least oneIngo Schwarze2014-12-161-3/+6
| | | | | | | 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.
* Empty conditions count as false.Ingo Schwarze2014-12-151-1/+3
| | | | | | When negated, they still count as false. Found when investigating crashes jsg@ found with afl. Not completely fixing the crashes yet.
* correct some character names to match groff;Ingo Schwarze2014-12-152-18/+18
| | | | reported by Carsten dot Kunze at arcor dot de
* Let "man n open" do the same as "man -s n open" again, that is,Ingo Schwarze2014-12-151-4/+5
| | | | | show the open(n) Tcl manual, as documented in man(1). Issue reported by Svyatoslav Mishyn <juef at openmailbox dot org> (Crux Linux).
* Catch localtime() failure for additional safety;Ingo Schwarze2014-12-151-1/+3
| | | | patch from Jan Stary <hans at stare dot cz> some time ago.
* version 1.13.2VERSION_1_13_2Ingo Schwarze2014-12-132-3/+3
|
* Fix a regression found by Carsten dot Kunze at arcor dot de:Ingo Schwarze2014-12-132-7/+14
| | | | Do not show bogus quotes when .Bl -column phrases are quoted.
* escape Nd on a macro lineIngo Schwarze2014-12-121-3/+3
|
* Guard some come needed for database support only by #if HAVE_SQLITE3.Ingo Schwarze2014-12-111-5/+20
| | | | Compiler warnings about unused code reported by wiz@NetBSD.
* Make this work on illumos:Ingo Schwarze2014-12-111-31/+9
| | | | | | | * define MAX() * ignore O_DIRECTORY if it isn't defined * garbage collect two unused variables Issues reported and fix tested by wiz@NetBSD.
* fix RCS IDsIngo Schwarze2014-12-111-1/+2
|
* sync to OpenBSDIngo Schwarze2014-12-113-7/+15
|
* new Copyright yearsIngo Schwarze2014-12-111-3/+3
|
* link to EuroBSDCon 2014Ingo Schwarze2014-12-111-3/+4
|
* correctly align document header and footer;Ingo Schwarze2014-12-101-4/+7
| | | | suggested by kristaps@
* the asciidoc/docbook toolchain uses braindead \h for indentationIngo Schwarze2014-12-101-3/+4
|
* more release preparationsIngo Schwarze2014-12-092-5/+77
|
* first cut at updating for the next releaseIngo Schwarze2014-12-091-18/+43
|
* Support choosing alternative binary and manual names from configure.local,Ingo Schwarze2014-12-094-19/+77
| | | | to help downstream distributions avoid naming conflicts.
* Integrate the makewhatis binary into the mandoc binaryIngo Schwarze2014-12-094-24/+29
| | | | | just like we do it on OpenBSD. Smaller and neater. While here, let ./configure set INSTALL_TARGETS.
* Some sorting and some more comments.Ingo Schwarze2014-12-091-19/+28
| | | | Drop DISTDIR from www-install target.
* Install "man" as a hardlink to "mandoc" during db-install.Ingo Schwarze2014-12-091-12/+8
| | | | | Install man(1) manual in db-install, not base-install. Get rid of the useless variables BASEBIN, DBBIN, CGIBIN.
* When opening mandoc.db fails, tell the user in which directory.Ingo Schwarze2014-12-061-2/+4
| | | | Improving an unhelpful error message reported by millert@.
* implement help(1)Ingo Schwarze2014-12-051-9/+22
|
* Improve parsing of function names.Ingo Schwarze2014-12-051-25/+28
| | | | This gets rid of the last bogus entries in base and Xenocara.
* Do not misinterpret function arguments as function names;Ingo Schwarze2014-12-051-1/+4
| | | | improves semantic analysis of more than 300 manuals.
* Render text before, not after accumulating flag bits, such that flagsIngo Schwarze2014-12-051-117/+108
| | | | | for different representations of the same string end up in the same database entry. Improves name classification for 500 manuals.
* When finding a .so link after the page was already processed,Ingo Schwarze2014-12-041-4/+17
| | | | | do not clobber the existing names flags; instead, OR the additional flags into them.
* correctly store .Dt and .TH information in the names tableIngo Schwarze2014-12-041-11/+28
|
* in the SYNOPSIS, add .Fo and first .Fn arguments to the names tableIngo Schwarze2014-12-041-2/+17
|
* In the SYNOPSIS, if .Nm occurs without argument, give the first .NmIngo Schwarze2014-12-041-25/+48
| | | | that occurred in the document a NAME_SYN entry in the names table.
* fix handling of roff requests having a default scale other than "n",Ingo Schwarze2014-12-043-6/+6
| | | | | in particular .sp which uses "v", when the scale is not specified; cures groff-mandoc differences in about a dozen Xenocara manuals
* Ignore macros that never produce any text when deciding whetherIngo Schwarze2014-12-041-13/+24
| | | | | | 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.
* delete five entries that were already fixedIngo Schwarze2014-12-031-24/+1
|
* Switch the default output mode from -Tascii to -Tlocale.Ingo Schwarze2014-12-022-9/+11
| | | | | | | | 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