summaryrefslogtreecommitdiff
path: root/usr.bin/mandoc
AgeCommit message (Collapse)Author
2014-12-23even if the second argument to .IP is invalid, don't print itIngo Schwarze
2014-12-23Fix vertical scaling. Obviously, nobody ever had a serious look at this.Ingo Schwarze
Basic units, centimeters, points, ens, ems, and the rounding algorithm were all wrong, only inches, pica, and the default vertical span worked.
2014-12-23In a2roffsu(), do not parse the number twice.Ingo Schwarze
Gets rid of 25 lines of code and one static buffer. No functional change for numbers shorter than BUFSIZ characters.
2014-12-23correctly handle scaling units after .PDIngo Schwarze
2014-12-22The code already pays attention not to close the same block twice.Ingo Schwarze
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
2014-12-21Use -m for macro set selection in mandoc(1) mode only, not in man(1)Ingo Schwarze
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>.
2014-12-21Fix build with -Werror -std=c99 -pedantic.Daniel Dickman
ok schwarze@
2014-12-20Fix two issues causing a class of assertion failures found by jsg@ with afl.Ingo Schwarze
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.
2014-12-20resolve some code duplication; no functional changeIngo Schwarze
2014-12-19Enforcing an arbitrary, implementation dependent, undocumented limitIngo Schwarze
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.
2014-12-19Rewrite the low-level UTF-8 parser from scratch.Ingo Schwarze
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%.
2014-12-18Don't let .Ta creep into an already-closed list; same as for .It.Ingo Schwarze
Fixes an assertion found by jsg@ with afl.
2014-12-18update usage() and the list of non-standard (i.e. non-posix) options;Jason McIntyre
ok schwarze
2014-12-18Only keep leading .Sm inside a list when it immediately precedesIngo Schwarze
the first .It. Otherwise, move it out together with whatever follows. Fixing an assertion failure found by jsg@ with afl.
2014-12-18When the head of a list item is extended with a partial explicitIngo Schwarze
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.
2014-12-18Don't let the modulo operator divide by zero.Ingo Schwarze
Found by jsg@ with afl.
2014-12-18The code is already careful to not add items to lists that wereIngo Schwarze
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.
2014-12-17Be a bit more lenient in what to accept for section names givenIngo Schwarze
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).
2014-12-16Ignore mdoc(7) and man(7) macros inside tbl(7) code because theyIngo Schwarze
would abort the table in an unclean way, causing assertion failures found by jsg@.
2014-12-16correct -Tutf8 and -Thtml rendering of \(~=Ingo Schwarze
and change the name of \(-~ to \(|= to agree with groff; difference found by Carsten dot Kunze at arcor dot de
2014-12-16Explicit block closure macros clobber next-line block head scope,Ingo Schwarze
just like explicit block macros themselves. Fixing an assertion failure jsg@ found with afl.
2014-12-16When a string comparison condition contains no mismatching characterIngo Schwarze
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).
2014-12-16When a numerical condition errors out after consuming at least oneIngo Schwarze
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.
2014-12-15Empty conditions count as false.Ingo Schwarze
When negated, they still count as false. Found when investigating crashes jsg@ found with afl. Not completely fixing the crashes yet.
2014-12-15correct some character names to match groff;Ingo Schwarze
reported by Carsten dot Kunze at arcor dot de
2014-12-15Let "man n open" do the same as "man -s n open" again, that is,Ingo Schwarze
show the open(n) Tcl manual, as documented in man(1). Issue reported by Svyatoslav Mishyn <juef at openmailbox dot org> (Crux Linux).
2014-12-15Merge from bsd.lv: text about HTML written by kristaps@.Ingo Schwarze
2014-12-15Catch localtime() failure for additional safety;Ingo Schwarze
patch from Jan Stary <hans at stare dot cz> some time ago.
2014-12-14Switch man(1) to the mandoc implementation.Ingo Schwarze
OK krw@ naddy@ sthen@ "commit it now" deraadt@ I won't remove the files in src/usr.bin/man, such that we can quickly switch back in case a problem is found.
2014-12-14minimally document -IOKTW; requested by naddy@Ingo Schwarze
2014-12-13just released mandoc 1.13.2Ingo Schwarze
2014-12-13Fix a regression found by Carsten dot Kunze at arcor dot de:Ingo Schwarze
Do not show bogus quotes when .Bl -column phrases are quoted.
2014-12-11slightly reshuffle some code to reduce the diff with portable;Ingo Schwarze
no functional change
2014-12-06When opening mandoc.db fails, tell the user in which directory.Ingo Schwarze
Improving an unhelpful error message reported by millert@.
2014-12-05implement help(1)Ingo Schwarze
2014-12-05Improve parsing of function names.Ingo Schwarze
This gets rid of the last bogus entries in base and Xenocara.
2014-12-05Do not misinterpret function arguments as function names;Ingo Schwarze
improves semantic analysis of more than 300 manuals.
2014-12-05Render text before, not after accumulating flag bits, such that flagsIngo Schwarze
for different representations of the same string end up in the same database entry. Improves name classification for 500 manuals.
2014-12-04When finding a .so link after the page was already processed,Ingo Schwarze
do not clobber the existing names flags; instead, OR the additional flags into them.
2014-12-04correctly store .Dt and .TH information in the names tableIngo Schwarze
2014-12-04in the SYNOPSIS, add .Fo and first .Fn arguments to the names tableIngo Schwarze
2014-12-04In the SYNOPSIS, if .Nm occurs without argument, give the first .NmIngo Schwarze
that occurred in the document a NAME_SYN entry in the names table.
2014-12-04fix handling of roff requests having a default scale other than "n",Ingo Schwarze
in particular .sp which uses "v", when the scale is not specified; cures groff-mandoc differences in about a dozen Xenocara manuals
2014-12-04Ignore macros that never produce any text when deciding whetherIngo Schwarze
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.
2014-12-02Switch the default output mode from -Tascii to -Tlocale.Ingo Schwarze
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
2014-12-02Fix the implementation and documentation of \c (continue text input line).Ingo Schwarze
In particular, make it work in no-fill mode, too. Reminded by Carsten dot Kunze at arcor dot de (Heirloom roff).
2014-12-01header cleanup:Ingo Schwarze
* add missing forward declarations * remove needless header inclusions * some style unification
2014-12-01The header libmandoc.h is part of the internal parser interface,Ingo Schwarze
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.
2014-11-30delete three standard abbreviations that areIngo Schwarze
* no longer used in our tree * not used in any of NetBSD, FreeBSD, or DragonFly * not supported by groff
2014-11-30Multiple fixes with respect to .Pf:Ingo Schwarze
* 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.