summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* When finding a .so link after the page was already processed,Ingo Schwarze2014-12-041-3/+16
| | | | | 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-10/+27
|
* in the SYNOPSIS, add .Fo and first .Fn arguments to the names tableIngo Schwarze2014-12-041-1/+16
|
* In the SYNOPSIS, if .Nm occurs without argument, give the first .NmIngo Schwarze2014-12-041-24/+47
| | | | 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-3/+3
| | | | | 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-12/+23
| | | | | | 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-23/+0
|
* Switch the default output mode from -Tascii to -Tlocale.Ingo Schwarze2014-12-022-6/+8
| | | | | | | | 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-0/+6
|
* we really need .taIngo Schwarze2014-12-021-1/+2
|
* Fix the implementation and documentation of \c (continue text input line).Ingo Schwarze2014-12-0210-25/+21
| | | | | 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-0/+513
|
* header cleanup:Ingo Schwarze2014-12-0115-32/+41
| | | | | | * 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-1/+0
| | | | | | 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-4/+3
| | | | | | | 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-56/+0
|
* typo; Svyatoslav Mishyn <juef at openmailbox dot org> (Crux Linux)Ingo Schwarze2014-11-301-1/+1
|
* delete three standard abbreviations that areIngo Schwarze2014-11-302-15/+2
| | | | | | * 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-10/+33
| | | | | | | * 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-8/+25
| | | | inspired by a similar warning in the groff_mdoc(7) macros
* Reduce code duplication by reusing the same argument parserIngo Schwarze2014-11-291-18/+20
| | | | | 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-128/+68
| | | | | | | | | | 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-124/+82
| | | | | | 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-49/+18
| | | | | 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-120/+5
| | | | | 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-181/+9
| | | | | | 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-3/+0
|
* mop up an #ifdef turd deraadt@ stepped intoIngo Schwarze2014-11-281-8/+2
|
* Be more careful about meta->name. For weird input, it can be NULL.Ingo Schwarze2014-11-281-6/+10
| | | | Fixing a NULL access jsg@ found with afl.
* Simplify by making the eqn and tbl steering functions void;Ingo Schwarze2014-11-284-41/+24
| | | | no functional change, minus 15 lines of code.
* Simplify by making many functions in the man(7) parser void,Ingo Schwarze2014-11-286-284/+181
| | | | and some cleanup; no functional change, minus 70 lines.
* Simplify by making the mdoc parser callbacks void, and some cleanup;Ingo Schwarze2014-11-283-215/+137
| | | | no functional change, minus 50 lines of code.
* Simplify the code by making various mdoc parser helper functions void.Ingo Schwarze2014-11-284-431/+268
| | | | No functional change, minus 130 lines of code.
* Simplify code by making mdoc validation handlers void.Ingo Schwarze2014-11-284-413/+284
| | | | No functional change, minus 90 lines of code.
* Downgrade .Bd -file from FATAL to ERROR.Ingo Schwarze2014-11-274-14/+14
| | | | | 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-22/+58
| | | | | | | | 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-39/+33
| | | | | 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-27/+25
| | | | | | | | 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-1/+1
|
* Let mparse_readfd() use mparse_open() and mparse_wait()Ingo Schwarze2014-11-262-28/+59
| | | | | | | | 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-32/+20
| | | | | 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-2/+0
|
* The .Sm macro accepts at most one argument;Ingo Schwarze2014-11-261-1/+1
| | | | fixing an assertion failure found by jsg@ with afl.
* Make the code sipler and more robust by always assigning a valueIngo Schwarze2014-11-261-11/+5
| | | | to q.manpath and dropping the (incomplete) later NULL checks.
* Allow comma-separated options in tbl(7) tables.Ingo Schwarze2014-11-262-2/+3
| | | | | Provides better groff compatibility. From bentley@.
* Completely rewrite the top level of the layout parser.Ingo Schwarze2014-11-251-56/+41
| | | | | | * 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-10/+2
| | | | from bentley@.
* Do not access a NULL pointer when a section has no body,Ingo Schwarze2014-11-252-7/+12
| | | | | 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-36/+30
| | | | | | | | | | | | | | | | | | | | | 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.
* Prevent negative arguments to the .ll request from causing integerIngo Schwarze2014-11-202-6/+10
| | | | | | | | | underflow. Found while preparing an audit of termp.rmargin. Overflow can also happen, but i see no sane way to deal with it, so just let it happen. It doesn't happen for any sane input anyway, groff behaviour is undefined, and the resulting values are legal, even though they are useless.