aboutsummaryrefslogtreecommitdiffstatshomepage
Commit message (Collapse)AuthorAgeFilesLines
...
* Ignore unreasonably large spacing modifiers in tbl layouts.Ingo Schwarze2020-09-0110-8/+135
| | | | | | 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-1/+2
|
* 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-10/+18
| | | | | | 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-2/+9
| | | | | | 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-2/+4
| | | | | | | | 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-1/+3
| | | | | 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-65/+159
| | | | | | | | | | | | | | | | | | | | 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-17/+4
|
* undocumented options -O outfilename and -O tagfilenameIngo Schwarze2020-07-215-38/+96
| | | | | 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-28/+51
| | | | | | | | | | | | | | | | | | | | | | 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-7/+8
| | | | 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-5/+11
| | | | | | | 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-1/+5
|
* Provide a real feature test for __attribute__().Ingo Schwarze2020-06-224-8/+57
| | | | | 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-20/+40
| | | | | | | | 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-1/+15
|
* Manually tag the section option.Ingo Schwarze2020-06-171-2/+3
| | | | | 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-45/+44
|
* 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-1/+18
|
* Support -T html -O tag by passing a file:// URI to the pager.Ingo Schwarze2020-06-151-17/+24
| | | | | 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-1/+2
|
* Only compile compat_*.c implementations that are actually needed.Ingo Schwarze2020-06-1520-252/+113
| | | | | 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-98/+72
| | | | | | | | | | * 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-6/+7
| | | | | | | 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-3/+7
| | | | This adds clarity and avoids compiler warnings.
* Fix a regression in rev. 1.319 (2019/03/03):Ingo Schwarze2020-06-141-2/+2
| | | | | | | 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-11/+95
| | | | | | | | | | | 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-2/+19
| | | | | 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-16/+52
| | | | | 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-11/+12
| | | | | | | | | 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 '~'.
* When .Bd, .D1, or .Dl is tagged, attach the permalinkIngo Schwarze2020-04-1923-73/+154
| | | | to the first few letters, similar to what was earlier done for .Pp.
* Correctly handle non-unique tags even when NODE_ID and NODE_HREF fallIngo Schwarze2020-04-193-54/+66
| | | | apart, NODE_ID occurring earlier than NODE_HREF.
* Major update:Ingo Schwarze2020-04-181-32/+137
| | | | | Complete includes, add several functions, no more <?xml?>, no more style attributes, NODE_HREF flag, mention roff_html.c.
* When a .Tg is attached to a paragraph, attach the permalinkIngo Schwarze2020-04-1819-44/+115
| | | | to the first word, or the first few words if they are short.
* Use a separate node->tag attribute rather than abusing the node->stringIngo Schwarze2020-04-087-71/+68
| | | | | attribute for the purpose. No functional change intended. The purpose is to make it possible to later attach tags to text nodes.
* Separate the place to put the <a href> permalink (now markedIngo Schwarze2020-04-0722-51/+154
| | | | | | | with NODE_HREF) from the target element of the link (still marked with NODE_ID). In many cases, use this to move the target to the beginning of the paragraph, such that readers don't get dropped into the middle of a sentence.
* Support manual tagging of .Pp, .Bd, .D1, .Dl, .Bl, and .It.Ingo Schwarze2020-04-0648-85/+333
| | | | | | In HTML output, improve the logic for writing inside permalinks: skip them when there is no child content or when there is a risk that the children might contain flow content.
* automatically tag .SH and .SS in man(7) terminal outputIngo Schwarze2020-04-049-6/+44
| | | | in the same way as it was done for .Sh and .Ss in mdoc(7)
* Remove some stray argument names from function prototypes,Ingo Schwarze2020-04-037-23/+37
| | | | | | for consistency with the dominant style used in mandoc. No functional change. Patch from Martin Vahlensieck <academicsolutions dot ch>.
* #include <stdint.h> because that is needed before #include <ohash.h>;Ingo Schwarze2020-04-031-1/+2
| | | | | fixing a build failure of mandoc-portable on Arch Linux reported by Stephen Gregoratto <dev at sgregoratto dot me>.
* When the last file formatted yielded no tags, the tags file gotIngo Schwarze2020-04-026-85/+70
| | | | | | | | | | | | | | | | | | | | | | | | | | deleted before starting the pager, even when earlier input files had written to it; thanks to weerd@ for reporting that bug. Since we now generate tags for section headers, we almost always generate at least some. Consequently, while fixing the above bug, simplify the code by never deleting the tags file before the pager exits, not even in the rare case that the file happens to be empty. Hence, this patch is -75 +63 LOC even though it fixes two bugs. While deleting the output files belongs after exit from the pager, closing them should be done before it is started. Collect the related code, which was scattered in various places, to where it belongs, in a dedicated function in the term_tag.c module. As a side benefit, never fclose(2) stdout, only dup2(2) to it. Similarly, when the -O tag argument wasn't found in the last file formatted, there was a complaint about "no such tag" even when the argument did occur in earlier files. Fix that by looking for a matching tag after every formatted file rather than just once at the very end. Given that command line arguments aren't properties of the file(s) being formatted, that check is a job for the main program, not for the formatters, so while fixing the check, move it from term_tag.c to main.c.
* Copy tagged strings before marking hyphens as breakable.Ingo Schwarze2020-04-0217-29/+48
| | | | For example, this makes ":tCo-processes" work in ksh(1).
* Just like we are already doing it in HTML output, automatically tagIngo Schwarze2020-04-0122-33/+124
| | | | | | | section and subsection headers in terminal output, too. Even though admittedly, commands like "/SEE" and "/ Subsec" work, too, there is no downside, and besides, with the recent improvements in the tagging framework, implementation cost is negligible.
* Even though the HTML, man, markdown, PDF, PostScript, and tree formattersIngo Schwarze2020-03-281-13/+10
| | | | | | never write a ctags(1) file, using a pager still requires writing the main output file and passing the file name to the pager. Recent regression mentioned on IRC and reported by kn@.
* test skipping of initial hyphens and minus signs in automatic tags;Ingo Schwarze2020-03-215-6/+42
| | | | related to tags.c rev. 1.30