summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Fix the "depend" target and regenerate Makefile.depend:Ingo Schwarze2015-07-142-24/+7
| | | | | | | * do not process the test-*.c files, they are not built via make * add the missing compat_stringlist.c and soelim.c * read.c now uses roff_int.h * roff.c no longer uses libmdoc.h
* headers should not contain macrosIngo Schwarze2015-07-141-0/+4
|
* Ignore blank characters at the beginning of a conditional block,Ingo Schwarze2015-06-271-0/+2
| | | | | that is, after "\{". Issue found by Markus <Waldeck at gmx dot de> in bash(1).
* delete some TODO entries that were already fixedIngo Schwarze2015-06-261-22/+10
|
* nice idea for eqn(7) from CDBUG.Ingo Schwarze2015-06-181-0/+5
|
* two new tasks i heard about at BSDCanIngo Schwarze2015-06-101-0/+10
|
* Avoid warning "defined but not used" when compiling with HAVE_MANPATH.Ingo Schwarze2015-06-101-0/+4
| | | | Issue found on Debian by Markus <Waldeck at gmx dot de>.
* Avoid warning "unused variable" when compiling without HAVE_WCHAR.Ingo Schwarze2015-06-101-0/+2
| | | | Issue found on Debian by Markus <Waldeck at gmx dot de>.
* Implement the roff(7) `r' (register exists) conditional.Ingo Schwarze2015-05-312-7/+36
| | | | | Missing feature found by Markus <Waldeck at gmx dot de> in Debian's bash(1) manual page.
* This one needs config.h too, if only for __BEGIN_DECLS.Ingo Schwarze2015-05-211-0/+1
| | | | Found on Solaris 11 in the OpenCSW cluster.
* add forgotten glueIngo Schwarze2015-05-211-0/+10
|
* Link compat_reallocarray.o into soelim; needed onIngo Schwarze2015-05-211-2/+2
| | | | platforms having neither stringlist nor compat_reallocarray.
* Remove clauses 3 and 4 from Christos Zoulas' BSD license.Ingo Schwarze2015-05-203-10/+2
| | | | | This is safe because Christos did that himself in NetBSD in 2008. No code change.
* fix integer overflows by using reallocarray(3)Ingo Schwarze2015-05-201-2/+3
|
* * fix roff terminology in .NdIngo Schwarze2015-05-201-3/+7
| | | | | * remove .Xr to self * add AUTHORS section
* Use PATH_MAX rather than the non-standard MAXPATHLEN.Ingo Schwarze2015-05-201-2/+2
|
* * remove FreeBSDismsIngo Schwarze2015-05-209-47/+99
| | | | | | | * purge and sort headers * add build and compat glue * and LICENSE information for soelim(1)
* Initial revisionIngo Schwarze2015-05-204-0/+433
|
* Do not let the -m option or MANPATH with leading, trailing, or doubleIngo Schwarze2015-05-071-5/+7
| | | | | | | | | colon override the default manpath, let them add to the default manpath. Only override the default manpath by the -M option, by MANPATH without leading, trailing, or double colon, or by "manpath" in man.conf(5). Problem reported by Jan Stary <hans at stare dot cz>. Patch OK'ed by millert@.
* mdoc_valid_post() may indirectly call roff_node_unlink() which mayIngo Schwarze2015-05-011-1/+1
| | | | | | | | | | | set ROFF_NEXT_CHILD, which is desirable for the final call to mdoc_valid_post() - in case the target itself gets deleted, the parse point may need this adjustment - but not for the intermediate calls - if intermediate nodes get deleted, that mustn't clobber the parse point. So move setting ROFF_NEXT_SIBLING to the proper place in rew_last(). This fixes the assertion failure in jsg@'s afl test case 108/Apr27.
* Setting the "last" member of struct roff_node was done at an extremelyIngo Schwarze2015-05-012-3/+2
| | | | | | | | weird place. Move it to the obviously correct place. Surprisingly, this didn't cause any misformatting in the test suite or in any base system manuals, but i cannot believe the code was really correct for all conceivable input, and it would be very hard to verify. At the very least, it cannot have worked for man(7).
* Minor bug fix: When .Pp rewinds .Nm, rewind the whole block,Ingo Schwarze2015-05-011-1/+1
| | | | | not just the body. In some unusual edge cases, this caused the .Pp to become a sibling of the .Nm body inside the .Nm block.
* If a block body gets broken, that's no good reason to extend theIngo Schwarze2015-04-291-1/+3
| | | | | | | scope of the end macro. Instead, only keep the tail scope open if the end macro macro calls an explicit macro and actually breaks that. This corrects syntax tree structure and fixes an assertion found by jsg@ with afl (test case 098/Apr27).
* Replace the kludge for the \z escape sequence by an actualIngo Schwarze2015-04-293-53/+35
| | | | | | | | implementation. As a side effect, minus ten lines of code. As another side effect, this also fixes the assertion failure that used to be triggered by "\z\o'ab'c" at the beginning of an output line, found by jsg@ with afl (test case 022/Apr27).
* Do not mark a block with the MDOC_BROKEN flag if it merely containsIngo Schwarze2015-04-291-0/+2
| | | | | | a mismatching explicit end macro without actually being broken. Avoids a subsequent upward search for the non-existent breaker ending up in a NULL pointer access; afl test case 005/Apr27 from jsg@.
* When the last line of a table layout turns out to be empty, it is deleted.Ingo Schwarze2015-04-291-0/+1
| | | | | Do not just free the struct tbl_row but also make sure that no pointer to it remains. Fixing a use after free found by jsg@ with afl.
* Improve the error message in case somebody has configured an invalid PAGER.Ingo Schwarze2015-04-291-2/+2
| | | | Suggested by Lorenzo Beretta <lory dot fulgi at infinito dot it>.
* Fix the HAVE_MANPATH case, got broken in rev. 1.23.Ingo Schwarze2015-04-281-1/+1
| | | | Patch from Steffen Nurpmeso <sdaoden at yandex dot com>, thanks.
* Unify mdoc_deroff() and man_deroff() into a common function deroff().Ingo Schwarze2015-04-238-100/+58
| | | | | | | | No functional change except that for mdoc(7), it now skips leading escape sequences just like it already did for man(7). Escape sequences rarely occur in mdoc(7) code and if they do, skipping them is an improvement in this context. Minus 30 lines of code.
* Get rid of two empty wrapper functions. No functional change.Ingo Schwarze2015-04-236-19/+2
|
* Avoid a use after free when the target node is deleted during validation.Ingo Schwarze2015-04-211-12/+15
| | | | Bug reported by jsg@.
* Fix previous: Don't let man(1) warn twice about non-existant names.Ingo Schwarze2015-04-201-5/+9
| | | | Again noticed by deraadt@.
* Avoid out-of-bounds read access before the beginning of theIngo Schwarze2015-04-201-1/+2
| | | | | mdoc_macros[] array. This sometimes prevented proper warnings about text nodes preceding the first section header.
* More than one data field may follow T} on the same input line.Ingo Schwarze2015-04-191-1/+2
| | | | | | | | Issue found by Christian Neukirchen <chneukirchen at gmail dot com> in the socket(2) manual on Linux. Also fixes major rendering bugs (including partial loss of content) in XkbChangeControls(3), XkbFreeClientMap(3), XkbGetMap(3), XkbKeyNumGroups(3), and XkbSetMap(3).
* If an explicit line break request (.br or .sp) occurs within an .HP block,Ingo Schwarze2015-04-191-0/+11
| | | | | | | the next line doesn't hang, but is simply indented. Issue found by Christian Neukirchen <chneukirchen at gmail dot com> in the dmsetup(8) manual on Linux. This patch also improves the indentation of XDGA(3) and XrmGetResource(3).
* If apropos(1) finds no match, print "nothing appropriate" to stderrIngo Schwarze2015-04-191-0/+2
| | | | | similar to what the old apropos did. Requested by and OK deraadt@.
* Unify trickier node handling functions.Ingo Schwarze2015-04-197-31/+31
| | | | | | | * man_elem_alloc() -> roff_elem_alloc() * man_block_alloc() -> roff_block_alloc() The functions mdoc_elem_alloc() and mdoc_block_alloc() remain for now because they need to do mdoc(7)-specific argument processing.
* Unify some node handling functions that use TOKEN_NONE.Ingo Schwarze2015-04-1911-148/+100
| | | | | | | | * mdoc_word_alloc(), man_word_alloc() -> roff_word_alloc() * mdoc_word_append(), man_word_append() -> roff_word_append() * mdoc_addspan(), man_addspan() -> roff_addtbl() * mdoc_addeqn(), man_addeqn() -> roff_addeqn() Minus 50 lines of code, no functional change.
* Decouple the token code for "no request or macro" from the individualIngo Schwarze2015-04-1911-57/+57
| | | | | | high-level parsers to allow further unification of functions that only need to recognize this code, but that don't care about different high-level macrosets beyond that.
* Unify node handling functions:Ingo Schwarze2015-04-1912-454/+323
| | | | | | | | | | | * node_alloc() for mdoc and man_node_alloc() -> roff_node_alloc() * node_append() for mdoc and man_node_append() -> roff_node_append() * mdoc_head_alloc() and man_head_alloc() -> roff_head_alloc() * mdoc_body_alloc() and man_body_alloc() -> roff_body_alloc() * mdoc_node_unlink() and man_node_unlink() -> roff_node_unlink() * mdoc_node_free() and man_node_free() -> roff_node_free() * mdoc_node_delete() and man_node_delete() -> roff_node_delete() Minus 130 lines of code, no functional change.
* Delete the wrapper functions mdoc_meta(), man_meta(), mdoc_node(),Ingo Schwarze2015-04-1812-102/+44
| | | | | | man_node() from the mandoc(3) semi-public interface and the internal wrapper functions print_mdoc() and print_man() from the HTML formatters. Minus 60 lines of code, no functional change.
* Unify {mdoc,man}_{alloc,reset,free}() into roff_man_{alloc,reset,free}().Ingo Schwarze2015-04-187-195/+100
| | | | | Minus 80 lines of code, no functional change. Written on the train from Koeln to Wolfsburg returning from p2k15.
* Move mdoc_hash_init() and man_hash_init() to libmandoc.hIngo Schwarze2015-04-188-15/+16
| | | | | and call them from mparse_alloc() and choose_parser(), preparing unified allocation of struct roff_man.
* Profit from the unified struct roff_man and reduce the number ofIngo Schwarze2015-04-189-80/+75
| | | | | arguments of mparse_result() by one. No functional change. Written on the ICE Bruxelles-Koeln on the way back from p2k15.
* Replace the structs mdoc and man by a unified struct roff_man.Ingo Schwarze2015-04-1826-300/+283
| | | | | Almost completely mechanical, no functional change. Written on the train from Exeter to London returning from p2k15.
* look at COHERENT troffIngo Schwarze2015-04-181-1/+4
|
* florian want <img> tags for https://tlakh.xyz/p2k15.7.htmlIngo Schwarze2015-04-161-0/+4
|
* Restore the page headers and page footers that accidentally got lostIngo Schwarze2015-04-161-6/+2
| | | | in rev. 1.225. Regression reported by florian@.
* shorten "outdated mandoc.db" warning message; requested by deraadt@Ingo Schwarze2015-04-161-4/+2
|
* Do not mistreat empty arguments to font alternating macrosIngo Schwarze2015-04-062-1/+9
| | | | as vertical spacing requests. Bug found with xmahjongg(6).