summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Using an undefined string or macro will cause it to be defined as empty.Ingo Schwarze2018-04-096-48/+191
| | | | | Observed by Werner Lemberg on Nov 14, 2011 and rotting on my TODO list ever since.
* Stop documenting the non-portable .R man(7) macro. Neither groffIngo Schwarze2018-04-051-15/+2
| | | | | nor the heirloom-doctools support it. Adding it was a mistake in the first place.
* Do not use a non-portable .R man(7) macro. Neither groff nor theIngo Schwarze2018-04-051-1/+1
| | | | | | heirloom-doctools support it. Work around the gap by using .BR with an empty first argument. This was noticed more than once in the past, but i always forgot to fix it.
* use the portable \(lq and \(rq internally rather than \(Lq and \(RqIngo Schwarze2018-04-053-47/+47
|
* For .Do/.Dq, use the documented and portable \(lq and \(rqIngo Schwarze2018-04-051-2/+2
| | | | | | | | | character escape sequences rather than the undocumented and non-portable \(Lq and \(Rq. Bug reported by Tim L <darkxst at github> via Thomas Klausner <wiz at NetBSD>; see https://github.com/nih-at/libzip/pull/42
* Ouch, fix previous: In the edge case of a single-character stringIngo Schwarze2018-03-161-1/+2
| | | | | containing nothing but a single hyphen, the pointer got incremented twice at one point, causing a read overrun found by naddy@.
* Style message about bad input encoding of em-dashes as -- instead of \(em.Ingo Schwarze2018-03-164-9/+74
| | | | Suggested by Thomas Klausner <wiz at NetBSD>; discussed with jmc@.
* Soften the language discouraging special character escape sequences.Ingo Schwarze2018-03-151-6/+20
| | | | | | | After i improved their ASCII renderings in groff and mandoc some time ago, mathematical symbols can now be used in specialised mathematical manual pages like libm and some X libraries. Tweaks and OK jmc@.
* Add strndup(3) compat implementation.Ingo Schwarze2018-02-274-1/+71
| | | | Jan Stary reports that MacOS X Snow Leopard and older lacks it.
* After opening a file with gzdopen(3), we have to call gzclose(3) orIngo Schwarze2018-02-231-6/+31
| | | | | | we leak memory internally used by zlib to keep compression state. Bug reported by Wolfgang Mueller <vehk at vehk dot de> who also provided an incomplete patch, part of which i'm using in this commit.
* clarify documentation of macro keysIngo Schwarze2018-02-231-0/+23
|
* Logically, the following are are type names - just like .Vt,Ingo Schwarze2018-02-231-5/+26
| | | | | | | | | | | | some of them with an optional variable name following: - .Ft - .Fa in the SYNOPSIS - .Fn second and later arguments in the SYNOPSIS So add these to the .Vt macro table in the mandoc.db(5) database. During my LibreSSL work, i'm getting really tired of typing $ man -k Vt,Ft,Fa=some_type_name over and over again; now, this becomes just: $ man -k Vt=some_type_name
* Invalidate the tag_files.tfd after fclose(3)ing the stram associatedIngo Schwarze2018-02-232-1/+4
| | | | | | with it. In main() assert that the tfd was actually invalidated. This avoids closing an invalid fd. From tb@; OK deraadt@ on an earlier version.
* In man(7) and cat pages, cut off excessive one line descriptions.Ingo Schwarze2018-02-071-2/+12
| | | | | An extreme example of how rogue files could mess up apropos(1) output was reported by bentley@: qwtlicense(3) in the x11/qwt port.
* Fix the mandoc_strndup() utility function. All existing callers seemIngo Schwarze2018-02-071-3/+3
| | | | | safe so far, but implementing it with an unchecked memcpy(3) is just wrong and quite dangerous.
* fix wrong dateIngo Schwarze2018-02-072-2/+2
|
* Delete the "no blank before trailing delimiter" check from theIngo Schwarze2018-02-0610-24/+8
| | | | | partial explicit macros. Leah Neukirchen <leah at vuxu dot org> rightfully points out that the check makes no sense for these macros.
* Remove the implicit display feature of .Lk because it was inconsistentIngo Schwarze2018-01-133-20/+2
| | | | | | | | | across output devices, counter-intuitive, and resulted in ugly output for many real-world manual pages. Always format even long links in-line. I already committed a similar change to groff. OK jmc@, bentley@, and the original author of the feature, Werner Lemberg <wl@gnu.org>.
* typo; from Alexander Kuleshov <kuleshovmail at gmail dot com>Ingo Schwarze2017-12-151-1/+1
|
* Recognize .Bl -column at parse time, and not only at validation time,Ingo Schwarze2017-11-291-9/+14
| | | | | | | even if other arguments precede -column. This is required because the .It parser needs to know whether or not we are a -column list. Fixes tree corruption leading to an assertion failure. Bug reported by bentley@.
* duplicate word, found by igor(1)Ingo Schwarze2017-11-281-1/+1
|
* streamline termp allocation: this will allow the init functionIngo Schwarze2017-11-101-14/+5
| | | | | to do things differently in the ps vs pdf case; from espie@
* be less assertive when warning about a possible typo;Ingo Schwarze2017-11-103-3/+3
| | | | from jca@, ok jmc@
* Shrink -Tps output by more than 50%Ingo Schwarze2017-11-022-15/+37
| | | | | | | | by using PostScript as a programming language. * Define and use one PostScript procedure to select each font. * Define and use procedures combining "use" and "show". * In one of these, reuse the current row if it did not change. Most ideas and most coding by espie@, tweaked by me.
* Print a human-readable media name in the %%DocumentMedia DSC commentIngo Schwarze2017-10-291-10/+27
| | | | | | | | | and use the setpagedevice PostScript operator to help printers automatically select the paper of the best matching PageSize. Many thanks to Mike Williams <obsd1 at eandem dot co dot uk> for teaching me about the relevant features of PostScript and DSC and for suggesting what to put into the first %%DocumentMedia argument.
* duplicate anchorsIngo Schwarze2017-10-281-0/+4
|
* more readable conversion of paper size from millimeters to PostScriptIngo Schwarze2017-10-261-2/+2
| | | | basic units, also slightly more precise
* The page footer line (psmarg) is created in ps_begin(), and theIngo Schwarze2017-10-251-2/+0
| | | | | | | | | | | last call writing to it is always ps_endline(), which ends with ps_pclose(), which prints "ET" (end text). Consequently, do not print another instance of "ET" in ps_closepage() after the footer line and before the "endstream" for the page. Fixing a PDF syntax error found while investigating the bug report from Jan Stary that also resulted in the previous commit.
* Properly close out the top-level Font object, the end-of-pageIngo Schwarze2017-10-251-3/+3
| | | | | | | Resource objects, and the Catalog object, fixing three PDF syntax errors that were present in every PDF file generated with mandoc since the initial checkin of the formatter in July 2010. Bug reported by Jan Stary <hans at stare dot cz> on misc@.
* Modernize documentation of .Ao and .Aq.Ingo Schwarze2017-10-231-15/+39
| | | | | | | | | | | | I looked through our whole tree and failed to find a single use that is really convincing, except those with .Mt. Putting it around character and key names is somewhat widespread and maybe acceptable, even if hardly useful. So for now, delete the bogus examples and explain what these macros are really used for. Discourage the most common abuses. Triggered by a question from Raf Czlonka <rczlonka at gmail dot com>.
* HISTORY: mention first appearance in OpenBSDIngo Schwarze2017-10-171-1/+3
|
* Do not segfault when there are two .Dt macros, the first withoutIngo Schwarze2017-09-121-1/+4
| | | | | an architecture argument and the second with an invalid one. Bug found by jsg@ with afl(1).
* typo: convertion -> convention; from dcoppa@Ingo Schwarze2017-09-071-1/+1
|
* fix a NULL pointer access on deroff() failure;Ingo Schwarze2017-09-061-0/+2
| | | | | could be triggered with '.SS ""'; reported by Michael <Stapelberg at debian>
* fix grammar; while here, improve spacing; from sobrado@Ingo Schwarze2017-09-041-1/+1
|
* format ".IP *" etc. as <ul> rather than <dl>Ingo Schwarze2017-09-021-0/+4
|
* Fix previous: mmap(2) returns MAP_FAILED on failure, not NULL.Ingo Schwarze2017-08-261-5/+5
| | | | Bug pointed out by tedu@.
* Do not fork and exec cmp(1); instead, simply fstat(2), mmap(2), andIngo Schwarze2017-08-261-39/+51
| | | | | | compare the files directly, allowing a much stricter pledge(2), at very little cost: merely 15 additional lines of very simple code. Suggested by George Brown <321 dot george at gmail dot com> on misc@.
* No need to fork and exec rm(1) -rf, we know that we have exactlyIngo Schwarze2017-08-261-20/+3
| | | | | | | | | one file and exactly one directory to remove. While here, increase the size of the buffer such that the file name actually fits. Minus 17 lines of code, no functional change. Opportunity for simplification reported by George Brown <321 dot george at gmail dot com> on misc@.
* remove spacing after another representation of unary minusIngo Schwarze2017-08-231-2/+4
|
* remove spacing after unary minusIngo Schwarze2017-08-231-2/+4
|
* eliminate white space after opening and before closing punctuationIngo Schwarze2017-08-234-5/+11
|
* use the tty-char macro file for ASCII comparisonsIngo Schwarze2017-08-231-1/+1
|
* Suppress spacing before certain kinds of lists.Ingo Schwarze2017-08-232-3/+13
| | | | | | | One benefit is a reduced probablity that a blank appears between a function name and the opening parenthesis introducing the arguments. The heuristics isn't perfect and may occasionally suppress a blank that wouldn't do harm.
* Improve ASCII rendering of a few rare character escape sequencesIngo Schwarze2017-08-233-13/+13
| | | | | that can be changed unilaterally because groff fails to render them at all.
* catch up with ASCII renderings in chars.c rev. 1.72Ingo Schwarze2017-08-2321-113/+118
|
* Switch ASCII rendering of the same mathematical symbols and greekIngo Schwarze2017-08-232-82/+82
| | | | | | | | | | letters as in groff commit babca15f from trying to imitate the characters' graphical shapes, which resulted in unintelligible renderings in many cases, to transliterations conveying the characters' meanings. One benefit is making these characters usable for portable manual pages. Solving a problem pointed out by bentley@.
* Correct the mandoc.db(5) requirements of man(1) after the deprecationIngo Schwarze2017-08-221-2/+6
| | | | of MLINKS. Inaccuracy pointed out by espie@.
* When finding a bogus database entry,Ingo Schwarze2017-08-221-0/+10
| | | | | print a meaningful warning and skip the entry. Issue reported by espie@.
* When the stdout stream gets broken, there is no point in readingIngo Schwarze2017-08-211-0/+11
| | | | | | | | | any more input files, and it would be misleading to start a parser, because that would show randomly truncated text. Instead, print an error message and exit the program. Issue found by Leah Neukirchen <leah at vuxu dot org>, who was surprised to see half a manpage when her /tmp/ overflew.