summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Correct an embarrassing spelling mistake:Ingo Schwarze2020-10-281-1/+1
| | | | The last name of the author of groff is "Clark".
* Improve the HISTORY and AUTHORS sections, using informationIngo Schwarze2020-10-281-10/+21
| | | | | received from Douglas McIlroy in private mail: https://manpages.bsd.lv/history/mcilroy_26_10_2020.txt
* error message simplifications requested by deraadt@Ingo Schwarze2020-10-261-0/+4
|
* The GNU tbl(1) program contained in the groff package internallyIngo Schwarze2020-10-257-17/+6
| | | | | | | | | | | | | | | | | | uses roff(7) tabulator settings to implement tables, and it used to leak the changed tabulator settings from tables to the subsequent roff(7) code. In mandoc/tbl_term.c rev. 1.54 (June 17, 2017), code was added to be bug-compatible with groff. In commit d0e03cf6 (Oct 20, 2020), GNU tbl(1) changed behaviour to save the tabulator settings before starting a table and restore them afterwards. Adjust mandoc for compatibility. Since mandoc implements tables without using roff(7) tabulator settings, saving and restoring tabulator settings is not needed in mandoc. Simply deleting the code that changed tabulator settings by reverting tbl_term.c rev. 1.54 is sufficient in mandoc. Also adjust the desired output of the regression tests to match the new behaviour of both groff and mandoc.
* Treat \*[.T] in the same way as \*(.T rather than calling abort(3).Ingo Schwarze2020-10-248-21/+35
| | | | | Bug found because the groff-current manual pages started using the variant form of this predefined string.
* In HTML output, avoid printing a newline right after <pre>Ingo Schwarze2020-10-1613-111/+58
| | | | | | | | and right before </pre> because that resulted in vertical whitespace not requested by the manual page author. Formatting bug reported by Aman Verma <amanraoverma plus vim at gmail dot com> on discuss@.
* add missing mention of Werner Lemberg,Ingo Schwarze2020-10-141-2/+7
| | | | | noticed by Werner himself on <groff at gnu dot org>; while here, add missing .An macros
* add example to apropos.1 to list all manuals in a given section;Ingo Schwarze2020-10-011-1/+5
| | | | patch from ians@
* Element next-line scopes can nest. Consequently, even when closingIngo Schwarze2020-09-096-15/+41
| | | | | | | | one element next-line scope, the MAN_ELINE flag must not yet be cleared if the parent macro is another element macro having next-line scope, or an assertion failure is caused if all this is wrapped in another macro that has block next-line scope, for example .TP. Bug found in an afl run performed by Jan Schreiber <jes at posteo dot de>.
* Do not abuse assert(3) to react to absurd input; the purpose of assert(3)Ingo Schwarze2020-09-091-2/+16
| | | | | | | | only is to catch internal inconsistencies in the program itself. Issue found in an afl run performed by Jan Schreiber <jes at posteo dot de>. Instead, just cut down unreasonably wide spacing requested by the document to a narrower width.
* assertion found in jes@'es afl run: .TS .if n .ceIngo Schwarze2020-09-071-0/+15
|
* After .ti, there are many reasons why the offset may change, so settingIngo Schwarze2020-09-062-7/+16
| | | | | | it back later requires a guard against underflow, or subsequent assertions may fail. Issue found in an afl run performed by Jan Schreiber <jes at posteo dot de>.
* Fix two issues with .po (page offset) formatting:Ingo Schwarze2020-09-034-7/+66
| | | | | | | | | | | | 1. Truncate excessive offsets to a width reasonable in the context of manual pages instead of printing excessively long lines and sometimes causing assertion failures; found in an afl run performed by Jan Schreiber <jes at posteo dot de>. 2. Remember both the requested and the applied page offset; otherwise, subtracting an excessive width, then adding it again, would end up with an incorrectly large offset. While here, simplify the code by reverting the previous offset up front, and also add some comments to make the general ideas easier to understand.
* If .ti had an excessive argument, using it was attempted, in someIngo Schwarze2020-09-034-13/+70
| | | | | | | | cases resulting in an assertion failure. Instead, truncate the temporary indent to a width reasonable in a manual page. I found the issue in an afl run that was performed by Jan Schreiber <jes at posteo dot de>.
* Do not indent by SIZE_MAX/2 when .ce occurs inside explicit no-fill mode.Ingo Schwarze2020-09-023-16/+29
| | | | | | | | While here, drop two unused arguments from the function term_field(); the related work was already done by term_fill() before this commit. I found the bug in an afl run that was performed by Jan Schreiber <jes at posteo dot de>.
* Ignore unreasonably large spacing modifiers in tbl layouts.Ingo Schwarze2020-09-0110-5/+132
| | | | | | Jan Schreiber <jes at posteo dot de> ran afl on mandoc and it turned out mandoc tried to use spacing modifiers so large that they would trigger assertion failures in term_ascii.c, function locale_advance().
* more info from John Gardner about ASCII control chars in roff(7) inputIngo Schwarze2020-09-011-0/+1
|
* Remove a lie reported by Jamie Landeg-Jones <jamie at catflap dot org>:Ingo Schwarze2020-08-271-4/+1
| | | | | The times when -T man may have expanded .so requests are long gone, nor would such a feature be useful. Use soelim(1) if you need that.
* Fix a regression caused by the insertion of two new tokens,Ingo Schwarze2020-08-271-9/+17
| | | | | | which unintentionally made the -O tag= argument mandatory, breaking commands like "man -akO tag Ic=ulimit". Noticed while answering questions from Ian Ropers.
* Make it more explicit that the statement "-O tag does not work with less(1)"Ingo Schwarze2020-08-271-1/+8
| | | | | | only applies to -T html output mode, and why. Of course, -O tag works just fine with less(1) in the -T ascii and -T utf8 output modes. Potential for confusion pointed out by Ian Ropers.
* Avoid artifacts in the most common case of closing conditional blocksIngo Schwarze2020-08-271-1/+3
| | | | | | | | when no arguments follow the closing brace, \}. For example, the line "'br\}" contained in the pod2man(1) preamble would throw a bogus "escaped character not allowed in a name" error. This issue was originally reported by Chris Bennett on ports@, and afresh1@ noticed it came from the pod2man(1) preamble.
* add a forgotten "#if HAVE_PLEDGE";Ingo Schwarze2020-08-071-0/+2
| | | | | patch sent in by <alexander dot gromnitsky at gmail dot com> who found the problem the hard way on Fedora 32
* Put the code handling \} into a new function roff_cond_checkend()Ingo Schwarze2020-08-038-64/+158
| | | | | | | | | | | | | | | | | | | | and call that function not only from both places where copies existed - when processing text lines and when processing request/macro lines in conditional block scope - but also when closing a macro definition request, such that this construction works: .if n \{.de macroname macro content .. \} ignored arguments .macroname This fixes a bug reported by John Gardner <gardnerjohng at gmail dot com>. While here, avoid a confusing decrement of the line scope counter in roffnode_cleanscope() for conditional blocks that do not have line scope in the first place (no functional change for this part). Also improve validation of an internal invariant in roff_cblock() and polish some comments.
* trivial sync with OpenBSDIngo Schwarze2020-07-302-10/+10
| | | | | in parts of these files that are not used by -portable; consequently, no functional change
* trivial adjustment of the desired test resultsIngo Schwarze2020-07-2128-155/+155
| | | | after getting rid of the "copyless" crutch
* adjust test framework to not require a ttyIngo Schwarze2020-07-212-16/+3
|
* undocumented options -O outfilename and -O tagfilenameIngo Schwarze2020-07-215-34/+92
| | | | | to support regression testing without a tty; no user visible change intended
* Switch the default pager from "more -s" to "less".Ingo Schwarze2020-07-206-20/+43
| | | | | | | | | | | | | | | | | | | | | | POSIX explicitly allows using a different default pager if that is documented. Nowadays, the pager provided in most operating systems is less(1). Our man(1) implementation uses less(1) features that traditional more(1) did not provide, in particular tagging. Besides, as noted by deraadt@, the user interface of less(1) is slightly more refined and preferable over the user inferface of more(1). This switch was originally suggested by Ian Ropers. In ./configure, test whether less(1) is available. If not, fall back to more(1). In ./configure.local, support overriding the automatic test by setting BINM_PAGER. As explained by jmc@ and deraadt@, the -s flag was added a very long time ago when an antique version of groff(1) had an annoying bug in terminal output that would randomly display blank lines in the middle of pages. Clearly, -s has no longer been needed for many years, so drop it from the default pager invocation. OK deraadt@ jmc@ martijn@ job@ on the OpenBSD version of this patch.
* Support the "powerpc64" architecture name.Ingo Schwarze2020-06-292-6/+7
| | | | The first file using it in .Dt was just committed by kettenis@.
* Briefly mention groff_mdoc(7) below SEE ALSO. While both authoritativeIngo Schwarze2020-06-251-3/+9
| | | | | | | manual pages document the same content, comparing can occasionally help in cases of doubt, and some people may prefer one style, some the other. While here, modernize a few .Lks from http:// to https://. OK jmc@
* more details about ASCII control charactersIngo Schwarze2020-06-241-0/+4
|
* Provide a real feature test for __attribute__().Ingo Schwarze2020-06-224-5/+54
| | | | | Looking at version numbers like __GNUC__ is always a bad idea. Believe it or not, this even makes ./configure shorter by one line.
* Because mandoc_aux.h and mandoc.h use __attribute__, all files thatIngo Schwarze2020-06-2211-19/+39
| | | | | | | | include mandoc_aux.h or mandoc.h need to include config.h, too. It is suspected that for example IRIX needs this, or it is likely to throw errors in these files because the system compiler doesn't understand __attribute__. Issue reported by Kazuo Kuroi <kazuo at irixnet dot org>.
* John Gardner: handling of ASCII control characters during inputIngo Schwarze2020-06-221-0/+14
|
* Manually tag the section option.Ingo Schwarze2020-06-171-0/+1
| | | | | Automatic tagging does not work because the [-s] flag is optional. Patch from Martin Vahlensieck.
* Sync stringlist implementation with NetBSD.Ingo Schwarze2020-06-152-45/+73
| | | | Various improvements of security, functionality, and style.
* sync with OpenBSD, no functional change intendedIngo Schwarze2020-06-152-43/+42
|
* update millert@'s email addressIngo Schwarze2020-06-151-3/+4
|
* document -T html -O tag as implemented in main.c rev. 1.350Ingo Schwarze2020-06-151-0/+17
|
* Support -T html -O tag by passing a file:// URI to the pager.Ingo Schwarze2020-06-151-16/+23
| | | | | Feature suggested by and implementation based on a patch from Abel Romero Perez <romeroperezabel at gmail dot com>.
* add missing compat_stringlist.o to ALL_COBJS, useful for make cleanIngo Schwarze2020-06-151-0/+1
|
* Only compile compat_*.c implementations that are actually needed.Ingo Schwarze2020-06-1520-244/+105
| | | | | That's cleaner and it is supposed to fix compiler warnings with gcc 10 reported by Wynn Wolf Arbor <wolf at oriole dot systems> on discuss@.
* Make the ./configure script simpler, more robust, and 23 lines shorter:Ingo Schwarze2020-06-143-95/+69
| | | | | | | | | | * three rather than four arguments for singletest() * let runtest() support testing two variants of compiler flags * always report a failed test, even when another test follows * run all tests before detecting fatal conditions * rename HAVE_CMSG_XPG42 to NEED_XPG4_2 for consistency * consistently use braces for shell variable interpolation * drop archaic "X${" syntax and unusual "==" in string comparisons
* merge rev. 1.58 from OpenBSD (deraadt@):Ingo Schwarze2020-06-141-5/+6
| | | | | | | recallocarray() the string buffer, to avoid leaving such contents around in the address space. Don't bother doing so for the buffer which contains aslr'd pointers... OK millert@
* Give the fts_compar struct member a real prototype.Ingo Schwarze2020-06-142-2/+6
| | | | This adds clarity and avoids compiler warnings.
* Fix a regression in rev. 1.319 (2019/03/03):Ingo Schwarze2020-06-141-1/+1
| | | | | | | Pass the right object to html_reset() or it will crash when rendering more than one manual page to HTML in a row. Bug reported by Abel Romero Perez <romeroperezabel at gmail dot com>. Patch from otto@.
* While we do not recommend the idiom ".Fl Fl long" for long optionsIngo Schwarze2020-04-268-9/+93
| | | | | | | | | | | because it is an abuse of semantic macros for device-specific presentational effects, this idiom is so widespread that it makes sense to convert it to the recommended ".Fl \-long" during the validation phase. For example, this improves HTML formatting in pages where authors have used the dubious .Fl Fl. Feature suggested by Steffen Nurpmeso <steffen at sdaoden dot eu> on freebsd-hackers.
* Resurrect the documentation of the print_otag() 's' attribute specifier,Ingo Schwarze2020-04-241-0/+17
| | | | | reverting a minor part of rev. 1.21. Contrary to what i thought, that attribute *is* still supported for a small number of unusual cases.
* provide a STYLE message when mandoc knows the file name and the extensionIngo Schwarze2020-04-247-11/+47
| | | | | disagrees with the section number given in the .Dt or .TH macro; feature suggested and patch tested by jmc@
* In fragment identifiers, use ~%d for ordinal suffixes,Ingo Schwarze2020-04-206-10/+11
| | | | | | | | | and reserve the character '~' for that purpose. Bug found by validator.w3.org in openssl(1), which contains both a tag "tls1_2" and a second instance of a tag "tls1", which also resulted in "tls1_2", causing a clash. Now, the second instance of "tls1" is rendered as "tls1~2" instead, employing the newly reserved '~'.