aboutsummaryrefslogtreecommitdiffstatshomepage
Commit message (Collapse)AuthorAgeFilesLines
...
* Reject the escape sequences \[uD800] to \[uDFFF] in the parser.Ingo Schwarze2015-10-131-1/+4
| | | | | | | These surrogates are not valid Unicode codepoints, so treat them just like any other undefined character escapes: Warn about them and do not produce output. Issue noticed while talking to stsp@, semarie@, and bentley@.
* Major character table cleanup:Ingo Schwarze2015-10-1322-653/+490
| | | | | | | | | | | | | * Use ohash(3) rather than a hand-rolled hash table. * Make the character table static in the chars.c module: There is no need to pass a pointer around, we most certainly never want to use two different character tables concurrently. * No need to keep the characters in a separate file chars.in; that merely encourages downstream porters to mess with them. * Sort the characters to agree with the mandoc_chars(7) manual page. * Specify Unicode codepoints in hex, not decimal (that's the detail that originally triggered this patch). No functional change, minus 100 LOC, and i don't see a performance change.
* Reduce the amount of code by moving the three copies of the ohashIngo Schwarze2015-10-137-135/+113
| | | | | callback functions into one common place, preparing for the use of ohash for some additional purposes. No functional change.
* Delete an assignment that is unconditionally overwritten two lines later;Ingo Schwarze2015-10-121-2/+1
| | | | | found by Svyatoslav Mishyn <juef at openmailbox dot org> with the clang static analyzer.
* Garbage collect an unused variable, no functional change;Ingo Schwarze2015-10-121-4/+3
| | | | found by Svyatoslav Mishyn <juef at openmailbox dot org> with cppcheck.
* Check the right pointer against NULL;Ingo Schwarze2015-10-121-2/+2
| | | | | fixing a pasto introduced in the previous commit; found by Svyatoslav Mishyn <juef at openmailbox dot org> with cppcheck.
* Use "-" rather than "\(hy" for the heads of .Bl -dash and -hyphen lists.Ingo Schwarze2015-10-121-2/+2
| | | | | | | In UTF-8 output, that renders as ASCII HYPHEN-MINUS (U+002D) rather than HYPHEN (U+2010), which looks better and matches groff. In ASCII output, it makes no difference. Suggested by naddy@.
* Clear dform and dsec when exiting a first-level directory in treescan().Ingo Schwarze2015-10-121-20/+23
| | | | | Fixes a segfault reported by bentley@. While here, do some style cleanup in the same function.
* Fix an obvious bug found during the /* FALLTHROUGH */ cleanup:Ingo Schwarze2015-10-121-2/+2
| | | | ASCII_NBRSP has to be rendered as "&nbsp;", not "-".
* To make the code more readable, delete 283 /* FALLTHROUGH */ commentsIngo Schwarze2015-10-1221-307/+25
| | | | | | that were right between two adjacent case statement. Keep only those 24 where the first case actually executes some code before falling through to the next case.
* Drop tags containing a blank character:Ingo Schwarze2015-10-111-2/+2
| | | | | | They don't work, they break other tags in weird ways, and even if they could be made to work, they would be mostly useless. Issue reported by naddy@, thanks.
* Finally use __progname, err(3) and warn(3).Ingo Schwarze2015-10-1114-139/+259
| | | | | | | | | | That's more readable and less error-prone than fumbling around with argv[0], fprintf(3), strerror(3), perror(3), and exit(3). It's a bad idea to boycott good interfaces merely because standards committees ignore them. Instead, let's provide compatibility modules for archaic systems (like commercial Solaris) that still don't have them. The compat module has an UCB Copyright (c) 1993...
* Mention that the first argument of .Pf does not need escaping.Ingo Schwarze2015-10-111-6/+10
| | | | | While here, make the first sentence regarding .Pf more concise. OK jmc@
* Decide whether to use_pager as early as possible,Ingo Schwarze2015-10-101-4/+6
| | | | in preparation for pledge(2); no functional change intended.
* modernize style: "return" is not a functionIngo Schwarze2015-10-0665-928/+932
|
* improve wording and start a new sentence on a new line; from jmc@Ingo Schwarze2015-10-061-4/+5
|
* Theo found a stray blank in HTML output.Ingo Schwarze2015-09-291-1/+7
|
* briefly document -T tree outputIngo Schwarze2015-09-261-2/+42
|
* Show the flags MDOC_DELIMO, MDOC_DELIMC, MDOC_EOS, and MAN_EOS.Ingo Schwarze2015-09-261-8/+18
| | | | Drop the "block-" prefixes from the node type names.
* /* NOTREACHED */ after abort() is silly, delete itIngo Schwarze2015-09-2614-42/+16
|
* resolve code duplication and do style cleanup in mdoc_nm_pre(),Ingo Schwarze2015-09-261-9/+5
| | | | no functional change
* Fix multiple aspects of SYNOPSIS .Nm formatting:Ingo Schwarze2015-09-261-3/+4
| | | | | | * Don't break lines before non-block .Nm elements. * Use proper <b> markup for the heads of .Nm blocks. * Make the width measurements work by doing them on the head children.
* typos; found and fixed by sobrado@Ingo Schwarze2015-09-242-10/+10
|
* Trailing whitespace is significant when determining the width of a tagIngo Schwarze2015-09-214-14/+21
| | | | | in mdoc(7) .Bl -tag and man(7) .TP, but not in man(7) .IP. Quirk reported by Jan Stary <hans at stare dot cz> on ports@.
* no more _subdir; Jan Stary <hans at stare dot cz>Ingo Schwarze2015-09-211-20/+2
|
* for portability, use (char *)NULL in execlp(3) as discussed on tech@ OpenBSDIngo Schwarze2015-09-161-3/+3
| | | | (didn't blow up anywhere yet, but better safe than sorry)
* Avoid .Ns right after .Pf, it's pointless.Ingo Schwarze2015-09-141-3/+3
|
* Remove the warning about children of .Vt blocks because actually,Ingo Schwarze2015-09-144-38/+6
| | | | | | | .Vt type global_variable No = Dv defined_constant ; is the best way to specify in the SYNOPSIS how a global variable is initialized in the rare case where that matters. Issue noticed by jmc@.
* The .Dv macro actually forces normal font.Ingo Schwarze2015-09-141-2/+2
|
* Fill mode changes don't break next-line scope in all cases,Ingo Schwarze2015-09-042-4/+18
| | | | | | in particular not for tagged paragraphs. Issue found by Christian Neukirchen <chneukirchen at gmail dot com> in the exiv2(1) manual page.
* Recommend an unambiguous escape for minus signs instead of \-.Ingo Schwarze2015-09-021-7/+7
| | | | | | | | | | | | | | | | | | | | | | Historically, \- was used in troff for three cases: flags/pathnames, en dashes, and minus signs. mandoc_char(7) currently recommends it for minus signs, recommends \(en for en dashes, and doesn't mention flags/pathnames. In the old days, nroff rendered \- as ASCII '-', and troff rendered it as en dash/minus (which were visually indistinguishable). In Unicode, en dashes and minus signs are semantically distinct and encoded differently (U+2013 for en dash, U+2212 for minus), and often rendered differently too. Meanwhile ASCII '-' has been renamed "hyphen-minus" and fonts typically render it closest to a hyphen, not a minus. There is very little consistency across roff implementations and output formats for what Unicode character \- corresponds to. So at least for minus signs, change the recommendation to the unambiguous \(mi escape. from bentley@, ok jmc@ (after reams of discussion)
* Drop leading, internal, and trailing blank characters in \o (overstrike)Ingo Schwarze2015-08-301-2/+8
| | | | | | escape sequences; that's cleaner for all output modes, and it's required to prevent the PostScript/PDF formatter from dying on assertions. Bug found by jsg@ with afl.
* If an .Fo macro lacks its mandatory argument, don't die on an assertion.Ingo Schwarze2015-08-301-4/+3
| | | | Bug found by jsg@ with afl.
* If we have to reparse the text line because we spring an input line trap,Ingo Schwarze2015-08-291-17/+18
| | | | | | we must not escape breakable hyphens yet, or mparse_buf_r() in read.c will complain and replace the escaped hyphens with question marks. Bug found in ocserv(8) following a report from Kurt Jaeger <pi at FreeBSD>.
* Parse and ignore the escape sequences \, and \/ (italic corrections).Ingo Schwarze2015-08-292-3/+13
| | | | | | | | Actually using these is very stupid because they are groff extensions and other roff(7) implementations typically print unintended characters at the places where they are used. Nevertheless, some manuals contain them, for example ocserv(8). Problem reported by Kurt Jaeger <pi at FreeBSD>.
* Implement the escape sequence \\$*, expanding to all argumentsIngo Schwarze2015-08-292-18/+31
| | | | | | of the current user-defined macro. This is another missing feature required for ocserv(8). Problem reported by Kurt Jaeger <pi at FreeBSD>.
* Minimal implementation of the read-only number register \n(.$Ingo Schwarze2015-08-291-9/+19
| | | | | | which returns the number of arguments of the current macro. This is one of the missing features required for ocserv(8). Problem reported by Kurt Jaeger <pi at FreeBSD>.
* Including <ohash.h> requires including <stdint.h> before,Ingo Schwarze2015-08-291-1/+4
| | | | | and "config.h" was missing as well. Patch from Svyatoslav Mishyn <juef and openmailbox dot org>, Crux Linux.
* tedu@ reports tbl(7) issues in synaptics(4)Ingo Schwarze2015-08-291-1/+15
|
* Remove the hack of scrolling forward and backward with +G1G thatIngo Schwarze2015-07-283-84/+99
| | | | | | | | | | many (jmc@, millert@, espie@, deraadt@) considered revolting. Instead, when using a pager, since we are using a temporary file for tags anyway, use another temporary file for the formatted page(s), as suggested by millert@ and similar to what the traditional BSD man(1) did, except that we use only one single temporary output file rather than one for each formatted manual page, such that searching (both with / and :t) works across all the displayed files.
* Simplify and make tag_put() more efficient by integrating tag_get()Ingo Schwarze2015-07-253-46/+19
| | | | | into it and by only handling NUL-terminated strings. Minus 25 lines of code, no functional change.
* implement tagging for .ErIngo Schwarze2015-07-251-2/+16
|
* basic tag support for function names; written at YYCIngo Schwarze2015-07-251-3/+18
|
* basic support for tag priorities; written at YYCIngo Schwarze2015-07-253-10/+12
|
* When creation of the temporary tags file fails, call the pagerIngo Schwarze2015-07-213-21/+17
| | | | | | | | without the -T option, because otherwise the pager won't even start. Fixing a bug reported by jca@. While here, shorten the code by two lines and delete one internal interface function.
* Do not fork and exec gunzip(1), just link with libz instead.Ingo Schwarze2015-07-198-148/+54
| | | | | | | As discussed with deraadt@, that's cleaner and will help tame(2). Something like this was also suggested earlier by bapt at FreeBSD. Minus 50 lines of code, deleting one interface function (mparse_wait), no functional change intended.
* If we aren't on a tty, clear the pager flag up front.Ingo Schwarze2015-07-191-3/+6
| | | | Just to clean up code structure, no functional change.
* Insist that manual page file name extensions must begin with a digit,Ingo Schwarze2015-07-181-2/+2
| | | | | lest pkg.conf(5) be shown when pkg(5) is asked for; issue reported by Michael Reed <m dot reed at mykolab dot com>.
* another portability todoIngo Schwarze2015-07-181-1/+8
|
* clean up the temporary file when the process dies from a signalIngo Schwarze2015-07-181-1/+17
|