summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* For now, it can't be helped that mandoc tbl(7) ignores high-level macros,Ingo Schwarze2015-01-286-27/+27
| | | | | | but stop throwing away their arguments. This fixes information loss in a handful of Xenocara manuals, at the price of a small amount of formatting noise creeping through.
* implement the tbl(7) "center" layout optionIngo Schwarze2015-01-282-3/+18
|
* adjust formatting for the tbl(7) layout 'x' modifier (maximize column)Ingo Schwarze2015-01-281-6/+30
| | | | to match groff for up to six maximized columns
* Multiple parser and formatter fixes for line drawing in tbl(7).Ingo Schwarze2015-01-275-158/+160
| | | | | | | | | | | | * Allow mixing vertical line bars with the layout options of the preceding layout cell. * Correctly combine box options with layout lines. * Correctly print vertical lines in data rows, with the right spacing. * Correctly print cross markers and left and right ends of horizontal lines even if vertical lines differ above and below. * Avoid the bogus error message "no table data cells" when a table data section starts with a horizontal line. No increase in code size.
* Rework tbl(7) layout parsing:Ingo Schwarze2015-01-265-169/+164
| | | | | | | | | | | * Continue parsing even if part of the input is invalid. * Do not require whitespace between cell specifications. * Allow tabs as well as blanks between modifiers. * Mark the 'm' modifier as unsupported. * Parse and ignore the 'p' and 'v' modifiers. * Better warning and error messages. * Get rid of a static buffer. Improved functionality but minus 50 lines of code.
* More improvements regarding tbl(7) options.Ingo Schwarze2015-01-265-87/+78
| | | | | | | | | * Treat "allbox" as an alias for "box" for now. * Parse and ignore the GNU tbl "nowarn" option. * For separation, allow spaces, tabs, and commas only. * Mark eqn(7) within tbl(7) as unsupported. * Simplify the option table. * Improve and sort documentation.
* Improve (or rather, rewrite) tbl(7) option parsing.Ingo Schwarze2015-01-265-184/+152
| | | | | | | | | | | | * Allow the layout to start after the semicolon on the options line. * Ignore leading commas. * Option arguments cannot contain closing parentheses. * Avoid needless UNSUPP messages. * Better ERROR reporting. * Delete unused "linesize" field in struct tbl_opts. * No need for static buffers. * Garbage collect one almost empty wrapper function. Improved functionality, but minus 40 lines of code.
* preserve .PP before .RE; effect found in audio/pms(1)Ingo Schwarze2015-01-241-1/+12
|
* Strangely, ignoring the roff(7) .na request was implemented in the man(7)Ingo Schwarze2015-01-248-13/+5
| | | | | parser. Simplify the code by moving it into the roff(7) parser, also making it work for mdoc(7).
* change .Cm to .Ar for macro argumentsIngo Schwarze2015-01-241-18/+18
|
* Support .RE with an argument; needed for audio/pms(1).Ingo Schwarze2015-01-245-6/+61
|
* new task: escape blank at the beginning of a lineIngo Schwarze2015-01-241-1/+5
|
* improve homebrew cellar config exampleIngo Schwarze2015-01-231-1/+2
|
* While ignoring the .ta (set tab stops) and .ti (temp indent) requestsIngo Schwarze2015-01-232-7/+7
| | | | | | is sometimes harmless, it often causes seriously ugly output, so flag these requests as unsupported rather than ignoring them. Discussed with naddy@.
* Let .Aq/.Ao/.Ac print "<>" instead of the normal "\(la\(ra"Ingo Schwarze2015-01-233-15/+15
| | | | | | when the only child is .Mt, not when the preceding node is .An, to improve robustness. Triggered by a question from Svyatoslav Mishyn <juef at openmailbox dot org> (Crux Linux).
* Wonders of roff(7): Integer numbers in numerical expressions can carryIngo Schwarze2015-01-232-2/+48
| | | | | scaling units, and some manuals (e.g. in devel/grcs) actually use that, so let's support it. Missing feature reported by naddy@.
* Slightly improve \w width measurements:Ingo Schwarze2015-01-221-1/+19
| | | | | | | Count special characters with the same width as ASCII characters and treat all other escape sequences as if they had a width of 0. Certainly not perfect, but a bit better. For example, GNU RCS ci(1) needs this; reported by naddy@.
* Traditional roff(7) explicitly allows certain control charactersIngo Schwarze2015-01-222-7/+10
| | | | | | | in the input stream (SOH, STX, ETX, ENQ, ACK, BEL, BS) for specific purposes (leaders, backspace, delimiters, .tr), but making sure these don't leak through to the output is tricky, so mark them as unsupported for now.
* Don't let a failing mparse_open() clobber the filename pointer;Ingo Schwarze2015-01-221-2/+6
| | | | | fixes error message content and a use after free for .so with non-existent target when -Wall or -Tlint is given.
* improve wording; patch from jmc@Ingo Schwarze2015-01-221-1/+1
|
* Support homebrew-style linking on Mac OS X.Ingo Schwarze2015-01-213-3/+21
| | | | Idea found together with Alexis Hildebrandt <surryhill at gmail dot com>.
* Rudimentary implementation of the roff(7) \o escape sequence (overstrike).Ingo Schwarze2015-01-216-16/+53
| | | | | | This is of some relevance because the pod2man(1) preamble abuses it for the icelandic letter Thorn, instead of simply using \(TP and \(Tp. Missing feature found by sthen@ in DateTime::Locale::is_IS(3p).
* Improve overstriking. When overstriking a wider character with aIngo Schwarze2015-01-211-3/+33
| | | | | | narrower one, center the latter horizontally. After a group of characters printed in the same position, advance by the width of the widest one among them.
* pass empty request lines through to tbl(7); sometimes, they end a layoutIngo Schwarze2015-01-211-10/+9
|
* blank lines in tables do not need special handling; simplifies codeIngo Schwarze2015-01-213-28/+15
| | | | and reduces groff/mandoc differences in OpenBSD base by about 1%
* typo fixes from jmc@Ingo Schwarze2015-01-202-4/+4
|
* Split the -Werror message level into -Werror (broken manual, probablyIngo Schwarze2015-01-207-113/+1273
| | | | | | | | | | | | | using mandoc is better than using groff) and -Wunsupp (manual using unsupported low-level roff(7) feature, probably using groff is better than using mandoc). Once this feature is complete, it is intended to help porting, making the decision whether to USE_GROFF easier. As a first step, distinguish four classes of roff(7) requests: 1. Supported (currently 24 requests) 2. Currently ignored because unimportant (120) -> no message 3. Ignored for good because insecure (14) -> -Werror 4. Currently unsupported (68) -> these trigger the new -Wunsupp messages
* change spelling of centre to center: consistent with other man pagesIngo Schwarze2015-01-205-9/+9
| | | | and the name of the syntax elements being described; from tedu@
* Make the man(1) and apropos(1) options -s and -S much less expensive:Ingo Schwarze2015-01-201-48/+22
| | | | | | | | | | | | | | Do not append an SQL clause looking into the large "keys" table. Instead, filter the result of the SQL query in buildnames() where equivalent data from the much smaller "mlinks" table is already available for free. This is relevant because man(1) uses the equivalent of "-S ${MACHINE}" by default since main.c rev. 1.216, to make sure that manuals for the current architecture are shown. With many ports installed, this patch can speed up man(1) by a factor of more than a hundred. Slowness reported by Theo Buehler <theo at math dot ethz dot ch>, thanks!
* Let man(1) show manuals for the current architecture by default,Ingo Schwarze2015-01-161-0/+5
| | | | | and support the MACHINE environment variable as documented in man(1). Missing feature reported by pascal@.
* Parse and ignore .IX (generate index entry) macros because pod2man(1)Ingo Schwarze2015-01-161-0/+2
| | | | | emits them, by default without defining them, relying on the roff(7) quirk that undefined macros have no effect.
* Fatal errors no longer exist.Ingo Schwarze2015-01-1512-158/+91
| | | | | | If a file can be opened, mandoc will produce some output; at worst, the output may be almost empty. Simplifies error handling and frees a message type for future use.
* downgrade .so failure from FATAL to ERRORIngo Schwarze2015-01-153-27/+26
|
* downgrade ".so with absolute path" from FATAL to ERROR;Ingo Schwarze2015-01-144-9/+10
| | | | allows to get rid of ROFF_ERR
* simplify by getting rid of ROFF_ERR in tbl(7) parsing; no functional changeIngo Schwarze2015-01-144-13/+12
|
* To get rid of SYSERR entries in enum mandocerr, downgrade problems withIngo Schwarze2015-01-143-44/+26
| | | | | | missing and unreadable files from SYSERR to ERROR. Needed for upcoming work. As a bonus, this minimally simplifies code and documentation.
* if earlier files set a non-zero exit status,Ingo Schwarze2015-01-141-6/+12
| | | | do not allow later files to reset it to zero
* Simplify handling of system errors: just exit(3).Ingo Schwarze2015-01-142-41/+15
| | | | | We already do the same for malloc(3) failure. The is no virtue in trying to survive failure of fork(2) and the like.
* Be developer-friendly, 'cause OpenBSD devs like to:Ingo Schwarze2015-01-131-4/+105
| | | | | | | | | | | | | cd /usr/src/share/man/man4; vi newdev.4 Makefile; make install; man newdev When a manual is missing from an outdated database, let man(1) show it anyway, using a KISS file system lookup as a fallback. Requested by deraadt@. 87 new lines of code doesn't seem too much bloat to me. Of course, keeping your mandoc.db(5) files up to date with makewhatis(8) or weekly(8) is still required for apropos(1) to find your new pages.
* do not spawn a pager when there is no output; issue pointed out by deraadt@Ingo Schwarze2015-01-131-24/+35
|
* Bugfix: When the invocation of a user-defined macro follows a roffIngo Schwarze2015-01-071-0/+1
| | | | | conditional request on the same input line, don't skip the first few bytes of its content.
* Fix a potential NULL pointer access in an error message after waitpid()Ingo Schwarze2015-01-031-22/+15
| | | | | failure; found using detailed information provided by Ulrich Spoerlein <uqs at FreeBSD> about FreeBSD Coverity CID 1261304.
* Given the excessively technical description in the old mdoc_samples(7)Ingo Schwarze2015-01-031-6/+15
| | | | | | | | | | 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>.
* Explicitly set the *data member of struct ohash_info to NULL.Ingo Schwarze2015-01-021-1/+3
| | | | | | | It is never dereferenced, but it gets copied around, which worries static analysis tools and might also confuse human auditors. FreeBSD Coverity CID 1261298, 1261299, 1261300, reported by Pedro Giffuni and Ulrich Spörlein <pfg@ and uqs@ at FreeBSD>.
* Fix a buffer overrun triggered by a trailing backslash at EOF inIngo Schwarze2015-01-011-4/+6
| | | | | | | 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.
* Fix a read buffer overrun triggered by trailing \s- or trailing \s+Ingo Schwarze2015-01-011-3/+3
| | | | without the required subsequent argument; found by jsg@ with afl.
* Don't dereference NULL pointers when formatting missing denominators,Ingo Schwarze2015-01-012-9/+12
| | | | | subscripts, superscripts, or "from" or "to" arguments. Found by jsg@ with afl.
* If man(1) only has one single argument, always interpret it as a name,Ingo Schwarze2015-01-011-1/+2
| | | | | | 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>.
* describe .Ql more precisely;Ingo Schwarze2014-12-311-2/+5
| | | | defect pointed out by Steffen Nurpmeso <sdaoden at yandex dot com>
* When showing more than one formatted manual page, insert horizontal linesIngo Schwarze2014-12-313-1/+21
| | | | | | 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.