aboutsummaryrefslogtreecommitdiffstatshomepage
Commit message (Collapse)AuthorAgeFilesLines
* 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
* note to self to not forget about groffIngo Schwarze2014-12-021-1/+7
|
* we really need .taIngo Schwarze2014-12-021-2/+3
|
* Fix the implementation and documentation of \c (continue text input line).Ingo Schwarze2014-12-0210-36/+32
| | | | | In particular, make it work in no-fill mode, too. Reminded by Carsten dot Kunze at arcor dot de (Heirloom roff).
* developer documentation regarding header filesIngo Schwarze2014-12-012-1/+514
|
* header cleanup:Ingo Schwarze2014-12-0115-46/+55
| | | | | | * add missing forward declarations * remove needless header inclusions * some style unification
* The header libmandoc.h is part of the internal parser interface,Ingo Schwarze2014-12-011-2/+1
| | | | | | 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.
* The file read.c is part of the parser, so it cannot include main.h,Ingo Schwarze2014-12-012-6/+5
| | | | | | | 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.
* remove unneccessary inclusion protection; patch from deraadt@Ingo Schwarze2014-12-0114-70/+14
|
* typo; Svyatoslav Mishyn <juef at openmailbox dot org> (Crux Linux)Ingo Schwarze2014-11-301-2/+2
|
* delete three standard abbreviations that areIngo Schwarze2014-11-302-18/+5
| | | | | | * no longer used in OpenBSD * not used in any of NetBSD, FreeBSD, or DragonFly * not supported by groff
* Multiple fixes with respect to .Pf:Ingo Schwarze2014-11-308-18/+41
| | | | | | | * 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.
* warn about attempts to call non-callable macros;Ingo Schwarze2014-11-304-13/+30
| | | | inspired by a similar warning in the groff_mdoc(7) macros
* Reduce code duplication by reusing the same argument parserIngo Schwarze2014-11-291-19/+21
| | | | | for in_line_eoln() macros and .Bl -column phrases. No functional change.
* Provide a helper function macro_or_word() and use it to prune theIngo Schwarze2014-11-293-130/+70
| | | | | | | | | | 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.
* Fold the loop around mdoc_argv() into the function itself,Ingo Schwarze2014-11-283-126/+84
| | | | | | 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.
* AT&T is unlikely to release an new version of Research UNIX any time soon.Ingo Schwarze2014-11-284-51/+20
| | | | | So, it's pointless to make adding version strings easy for downstream. One source file less to maintain.
* Retire support for CSRG supplementary document titles. These areIngo Schwarze2014-11-286-124/+9
| | | | | long obsolete and were never written in mdoc(7) in the first place. Removes 100 lines from source files.
* Drop useless architecture table. Validating architecture namesIngo Schwarze2014-11-288-189/+17
| | | | | | 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@.
* kill a pointless assertIngo Schwarze2014-11-281-4/+1
|
* mop up an #ifdef turd deraadt@ stepped intoIngo Schwarze2014-11-281-9/+3
|
* Be more careful about meta->name. For weird input, it can be NULL.Ingo Schwarze2014-11-281-7/+11
| | | | Fixing a NULL access jsg@ found with afl.
* Simplify by making the eqn and tbl steering functions void;Ingo Schwarze2014-11-284-45/+28
| | | | no functional change, minus 15 lines of code.
* Simplify by making many functions in the man(7) parser void,Ingo Schwarze2014-11-286-289/+186
| | | | and some cleanup; no functional change, minus 70 lines.
* Simplify by making the mdoc parser callbacks void, and some cleanup;Ingo Schwarze2014-11-283-218/+140
| | | | no functional change, minus 50 lines of code.
* Simplify the code by making various mdoc parser helper functions void.Ingo Schwarze2014-11-284-434/+271
| | | | No functional change, minus 130 lines of code.
* Simplify code by making mdoc validation handlers void.Ingo Schwarze2014-11-284-417/+288
| | | | No functional change, minus 90 lines of code.
* Downgrade .Bd -file from FATAL to ERROR.Ingo Schwarze2014-11-274-19/+19
| | | | | Since this was the last remaining FATAL error in this area, this change will allow major simplifications in the mdoc(7) parser.
* Multiple fixes with respect to .Eo:Ingo Schwarze2014-11-274-26/+62
| | | | | | | | 1. Correctly parse stray .Ec without preceding .Eo, avoiding an assertion violation found by jsg@ with afl. 2. Correctly parse .Ec arguments when breaking another block. 3. Correct spacing around closing delimiter when breaking another block. 4. Sync some related formatting control from -Tascii to -Thtml.
* Fix the obsolete .Db (toggle debug mode) macro to ignore its argumentsIngo Schwarze2014-11-275-45/+39
| | | | | and not trigger an assertion when there is more than one argument; the latter found by jsg@ with afl.
* Make makewhatis(8) understand .so links to .gz pages.Ingo Schwarze2014-11-273-30/+28
| | | | | | | | Drop the FORM_GZ annotation in the mpages table; it is conceptually wrong because it ought to be in the mlinks table: An uncompressed .so link file can point to a compressed manual page file and vice versa. Besides, it is no longer needed because mparse_open() handles it all. Sprinkle some KNF while here.
* fix build when HAVE_MANPATH is set; patch from <bapt at FreeBSD>Ingo Schwarze2014-11-271-2/+2
|
* Let mparse_readfd() use mparse_open() and mparse_wait()Ingo Schwarze2014-11-262-30/+61
| | | | | | | | and let mparse_open() fall back to .gz files such that .so works even when the target is zipped, requested by and in part using ideas from <bapt at FreeBSD>. While here, make sure files are readable before forking, both for efficiency and for better error reporting.
* Simplify the mparse_open()/mparse_wait() interface.Ingo Schwarze2014-11-266-39/+27
| | | | | Don't bother the user with the PID of the child process, store it inside the opaque mparse handle.
* remove an unreachable warning about .Sm argumentsIngo Schwarze2014-11-261-3/+1
|
* The .Sm macro accepts at most one argument;Ingo Schwarze2014-11-261-2/+2
| | | | fixing an assertion failure found by jsg@ with afl.
* Make the code sipler and more robust by always assigning a valueIngo Schwarze2014-11-261-12/+6
| | | | to q.manpath and dropping the (incomplete) later NULL checks.
* Allow comma-separated options in tbl(7) tables.Ingo Schwarze2014-11-262-5/+6
| | | | | Provides better groff compatibility. From bentley@.
* Completely rewrite the top level of the layout parser.Ingo Schwarze2014-11-251-57/+42
| | | | | | * Do not allocate lines unless there are cells. * Make the MANDOCERR_TBLNOLAYOUT message actually work. Also get rid of one static function and two goto statements.
* "Aq foo" is not the same as "<foo>". Don't use it to mark up HTML;Ingo Schwarze2014-11-251-12/+4
| | | | from bentley@.
* Do not access a NULL pointer when a section has no body,Ingo Schwarze2014-11-252-9/+14
| | | | | which can for example happen for .Sh Xo .Sh without .Xc. Crash found by jsg@ with afl.
* We repeatedly observed assertion crashes in the low-level terminalIngo Schwarze2014-11-213-39/+33
| | | | | | | | | | | | | | | | | | | | | output handler because the high level terminal formatters could be tricked into setting the left margin further to the right than the right margin. Today, jsg@ found more of these with afl. Change the internal interface between both levels, aiming for simplicity and robustness of the code. Treat both margins as *independent* settings: Now, termp.offset is the requested left margin, and termp.rmargin is the available space. Let the lower level cope with that case of insufficient space. Obviously, high level code that does centering or flush right still has to do careful checks, so i did a full audit of margin settings in the terminal formatters. Fixes crashes caused by excessively long title or date strings in the man(7) footer, operating system or date strings in the mdoc(7) footer, volume strings in the man(7) or mdoc(7) header, and a few cases related to some non-prologue macros.