Branch :
| Author | Commit | Date | CI | Message |
|---|---|---|---|---|
| 90f584c6 | 2020-07-21 15:08:48 | undocumented options -O outfilename and -O tagfilename to support regression testing without a tty; no user visible change intended | ||
| e886970e | 2020-07-20 14:52:12 | as jmc@ points out, i missed a few instances of .Xr more 1 | ||
| c9771691 | 2020-07-20 14:25:22 | Switch the default pager from "more -s" to "less". POSIX explicitly allows using a different default pager if that is documented. The pager provided in the OpenBSD base system is less(1). It can merely be called as more(1) for compatibility. 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. 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@ | ||
| ab2c7ff4 | 2020-06-29 19:16:59 | Support the "powerpc64" architecture name. The first file using it in .Dt was just committed by kettenis@. | ||
| ae375af6 | 2020-06-17 19:41:25 | Manually tag the section option. Automatic tagging does not work because the [-s] flag is optional. Patch from Martin Vahlensieck. | ||
| f32c3515 | 2020-06-15 18:05:25 | document -T html -O tag as implemented in main.c rev. 1.253 | ||
| cdecd8e7 | 2020-06-15 17:25:03 | Support -T html -O tag by passing a file:// URI to the pager. Feature suggested by and implementation based on a patch from Abel Romero Perez <romeroperezabel at gmail dot com>. | ||
| e1292dcd | 2020-06-11 16:12:14 | Fix a regression in rev. 1.238 (2019/07/26): 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>. Ingo came up with the same diff and I'm borrowing his draft commit message. ok schwarze@ | ||
| b952e091 | 2020-04-26 21:29:45 | While we do not recommend the idiom ".Fl Fl long" for long options 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. | ||
| ee646987 | 2020-04-24 11:58:02 | provide a STYLE message when mandoc knows the file name and the extension disagrees with the section number given in the .Dt or .TH macro; feature suggested and patch tested by jmc@ | ||
| 17117656 | 2020-04-20 12:59:24 | In fragment identifiers, use ~%d for ordinal suffixes, 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 '~'. | ||
| a875cd0e | 2020-04-19 16:26:11 | When .Bd, .D1, or .Dl is tagged, attach the permalink to the first few letters, similar to what was earlier done for .Pp. | ||
| 6e69d8cf | 2020-04-19 15:15:54 | Correctly handle non-unique tags even when NODE_ID and NODE_HREF fall apart, NODE_ID occurring earlier than NODE_HREF. | ||
| 6e2a0df9 | 2020-04-18 20:28:46 | When a .Tg is attached to a paragraph, attach the permalink to the first word, or the first few words if they are short. | ||
| c220f9cf | 2020-04-08 11:54:14 | Use a separate node->tag attribute rather than abusing the node->string attribute for the purpose. No functional change intended. The purpose is to make it possible to later attach tags to text nodes. | ||
| 9226948c | 2020-04-07 22:45:37 | Separate the place to put the <a href> permalink (now marked 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. | ||
| e053e0fd | 2020-04-06 09:55:49 | Support manual tagging of .Pp, .Bd, .D1, .Dl, .Bl, and .It. 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. | ||
| e9f36175 | 2020-04-04 20:23:06 | automatically tag .SH and .SS in man(7) terminal output in the same way as it was done for .Sh and .Ss in mdoc(7) | ||
| 6a6803e4 | 2020-04-03 11:34:19 | Remove some stray argument names from function prototypes, for consistency with the dominant style used in mandoc. No functional change. Patch from Martin Vahlensieck <academicsolutions dot ch>. | ||
| 24807e10 | 2020-04-03 10:29:01 | #include <stdint.h> because that is needed before #include <ohash.h>; fixing a build failure of mandoc-portable on Arch Linux reported by Stephen Gregoratto <dev at sgregoratto dot me>. | ||
| beabc24c | 2020-04-02 22:10:27 | When the last file formatted yielded no tags, the tags file got 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. | ||
| 5ff59bf7 | 2020-04-02 14:55:29 | Copy tagged strings before marking hyphens as breakable. For example, this makes ":tCo-processes" work in ksh(1). | ||
| ba1a6076 | 2020-04-01 20:10:17 | Just like we are already doing it in HTML output, automatically tag 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. | ||
| 4826a235 | 2020-03-28 16:16:42 | Even though the HTML, man, markdown, PDF, PostScript, and tree formatters 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@. | ||
| d55e8c17 | 2020-03-21 00:17:01 | When setting automatic tags, skip initial hyphens and minus signs, bringing the behaviour for mdoc(7) closer to what is already done for man(7). Triggered by the observation of kn@ that automatic tagging didn't work very well for find(1) primaries. OK kn@ | ||
| 342e7173 | 2020-03-19 12:20:45 | The tag file always needs to be closed before starting the pager, even when no output formatter was allocated because all pages shown were preformatted. Regression in previous reported by <Andreas dot Kahari at abc dot se> on bugs@. | ||
| 4c8dba62 | 2020-03-13 16:14:14 | Properly reset the validation part of the tagging module between files. This fixes a crash in makewhatis(8) encountered by naddy@. I'm very sorry for the disruption of the build. | ||
| 0ac7e6ec | 2020-03-13 00:31:04 | Split tagging into a validation part including prioritization in tag.{h,c} and {mdoc,man}_validate.c and into a formatting part including command line argument checking in term_tag.{h,c}, html.c, and {mdoc|man}_{term|html}.c. Immediate functional benefits include: * Improved prioritization of automatic tags for .Em and .Sy. * Avoiding bogus automatic tags when .Em, .Fn, or .Sy are explicitly tagged. * Explicit tagging of .Er and .Fl now works in HTML output. * Automatic tagging of .IP and .TP now works in HTML output. But mainly, this patch provides clean earth to build further improvements on. Technical changes: * Main program: Write a tag file for ASCII and UTF-8 output only. * All formatters: There is no more need to delay writing the tags. * mdoc(7)+man(7) formatters: No more need for elaborate syntax tree inspection. * HTML formatter: If available, use the "string" attribute as the tag. * HTML formatter: New function to write permalinks, to reduce code duplication. Style cleanup in the vicinity while here: * mdoc(7) terminal formatter: To set up bold font for children, defer to termp_bold_pre() rather than calling term_fontpush() manually. * mdoc(7) terminal formatter: Garbage collect some duplicate functions. * mdoc(7) HTML formatter: Unify <code> handling, delete redundant functions. * Where possible, use switch statements rather than if cascades. * Get rid of some more Yoda notation. The necessity for such changes was first discussed with kn@, but i didn't bother him with a request to review the resulting -673/+782 line patch. | ||
| 66c5de26 | 2020-02-27 22:26:26 | The HTML standard does not allow self-closing syntax for non-void elements. Consequently, write an explicit end tag for <mark> elements. | ||
| 9a542ed3 | 2020-02-27 21:38:27 | Fully support explicit tagging of .Sh and .Ss. This fixes the offset of two lines in terminal output and this improves HTML output by putting the id= attribute and <a> element into the respective <h1> or <h2> element rather than writing an additional <mark> element. To that end, introduce node flags NODE_ID (to make the node a link target, for example by writing an HTML id= attribute or by calling tag_put()) and NODE_HREF (to make the node a link source, used only in HTML output, used only to write an <a class="permalink"> element). In particular: * In the validator, generalize the concept of the "next node" such that it also works before .Sh and .Ss. * If the first argument of .Tg is empty, don't forget to complain if there are additional arguments, which will be ignored. * In the terminal formatter, support writing of explicit tags for all kinds of nodes, not just for .Tg. * In deroff(), allow nodes to have an explicit string representation even when they aren't text nodes. Use this for explicitly tagged section headers. Suprisingly, this is sufficient to make HTML output work, without explicit code changes in the HTML formatter. * In syntax tree output, display NODE_ID and NODE_HREF. | ||
| 7ebbefbe | 2020-02-27 01:25:57 | Introduce the concept of nodes that are semantically transparent: they are skipped when looking for previous or following high-level macros. Examples include roff(7) .ft, .ll, and .ta, mdoc(7) .Sm and .Tg, and man(7) .DT and .PD. Use this concept for a variety of improved decisions in various validators and formatters. While here, * remove a few const qualifiers on struct arguments that caused trouble; * get rid of some more Yoda notation in the vicinity; * and apply some other stylistic improvements in the vicinity. I found this class of issues while considering .Tg patches from kn@. | ||
| e8a031dc | 2020-02-24 21:15:05 | Marc Espie reported that "man p*ipc" displayed the perlipc(1) manual. The reason was that as a last resort when failing to find a page name in mandoc.db(5) or at a few well well-defined fully qualified file names, man(1) uses glob(3) to look for candidate files in relevant directories, because some operating systems have weird file name extensions, for example pcap.3pcap and BF_set_key.3ssl on Linux. But during that globbing, the metacharacters "*?[" need to be escaped in the name, section, and path supplied by the user, or you would get weird false positives and misleading warning messages and would be unable to use the fallback for path or file names that actually contain an opening bracket. Feedback and OK espie@. | ||
| 28ac7daa | 2020-02-20 22:55:10 | bugfix: indented paragraph macros need a space character before the width argument | ||
| 8b1bef1a | 2020-02-20 00:29:10 | bugfix: .Tg must be ignored completely in these output modes | ||
| 8affcc51 | 2020-02-15 15:28:01 | mention that -T man does not support eqn(7) and tbl(7); triggered by a question from Stephen Gregoratto <dev at sgregoratto dot me> | ||
| 0c1d2fcc | 2020-02-13 16:16:03 | Digit-width and narrow spaces are non-breaking. Noticed because Branden Robinson worked on related documentation in groff. | ||
| d28d6572 | 2020-02-12 21:14:24 | In roff, a space character at the beginning of an input line requires starting a new output line, and merely starting a new line of HTML code isn't sufficient to achieve that. Solve this in the same way as mdoc_html.c already does it, by printing a <br/> element. Fixing a bug reported by Jason A. Donenfeld <Jason at zx2c4 dot com> in the wg-quick(8) manual page on manpages.debian.org. | ||
| 6709a814 | 2020-02-10 14:42:03 | Finally delete support for the "_whatdb" configuration directive, which has a misleading syntax. It was declared obsolete and superseded by the "manpath" directive five years ago. | ||
| db5b0f16 | 2020-02-10 13:49:04 | For compatibility with the man(1) implementations of the man-1.6 and man-db packages, print the manpath if the -w option is given without a following name argument. This quirk has been in man-1.6 since at least man-1.5e (1998) and in man-db since 2012. Using this feature in portable software is a dubious idea because the internal organization of manual page directories varies in about a dozen respects among operating systems, so even if you get the answer, there is no portable way to use it for looking up anything inside. However, Matej Cepl <mcepl at suse dot cz> made me aware that some software, for example the manual viewing functionality in the newest editors/neovim code, unwisely relies on this feature anyway. No objections were raised when this patch was shown on tech@. | ||
| c9d6433d | 2020-02-10 13:18:20 | briefly mention /etc/examples/ in the FILES section of all the manual pages that document the corresponding configuration files; OK jmc@, and general direction discussed with many | ||
| 01c04610 | 2020-02-08 01:09:57 | correct Research Unix edition "appeared in" use in HISTORY Starting from "Combined Table of Contents" in Doug McIlroy's "A Research UNIX Reader" a table of which edition manuals appeared in. Checked against manuals from bitsavers/TUHS and source from TUHS where available. Ingo points out there are cases where something is included but not documented until a later release. bcd(6) v6 v7 printf(3) v2 v4 abort(3) v5 v6 system(3) v6 v7 fmod(3) v5 v6 ok schwarze@ | ||
| b3eeebc7 | 2020-02-06 19:41:34 | Make sure that -l always causes -w to be ignored, as documented in the man(1) manual page. This bugfix is needed to prevent the command "man -lw" from dereferencing a NULL pointer. | ||
| 4f2bc1d1 | 2020-01-26 21:24:58 | Repair more of the issues that i found in filescan() while investigating the report from <Andreas dot Kahari at abc dot se> on ports@: For a symlink, use the first of the following names that is available: 1. In -t mode, the symlink itself (unchanged). 2. When the (unresolved) symlink already resides inside the manpath, just strip the manpath and use the rest (unchanged). 3. When prefix(es) of the unresolved symlink point to the manpath, strip the longest such prefix and use the rest (new); this fixes situations where the manpath or one of its parent directories is a symlink and at the same time contains symlinks to manual pages. 4. Fall back to the fully resolved symlink, with the manpath stripped (new); this may for example happen when the command line passes symlinks from outside the manpath that point to manual pages inside the manpath, or if manual page trees contain symlinks to symlinks and not all of them are given on the command line. The fallback (4) isn't perfect. You can construct symlink spaghetti in such a way that this algorithm will not enter all manual page names into the database that a human would be able to deduce. But i do not expect such spaghetti to actually occur in practice (not even in ports), and a full fix would require re-implementing realpath(3) in terms of step-by-step readlink(2) calls, repeating the complicated algorithm (3) after each step. While here, also stop using PATH_MAX as the size of a static buffer in filescan(); on some systems, it can be unreasonably large. Instead, allocate path strings dynamically. | ||
| 7fec9d6a | 2020-01-26 11:15:49 | Fix incorrect file type tests. This bug caused sockets and character special devices to be accepted as manual pages if they appeared inside manpaths, and it caused incorrect file names to be entered into the database when the manpath or one of its parent directories was a symbolic link. This fixes the issues reported by <Andreas dot Kahari at abc dot se> on ports@, but additional issues remain when symbolic links are contained in a manpath that involves another symbolic link. | ||
| fa397007 | 2020-01-25 22:59:14 | Minor cleanup, no functional change: Do not abuse strstr(3) to check whether one long string starts with another long string. Instead, use strncmp(3) with the proper length. In set_basedir(), also reset *basedir in the error brances for extra safety. While here, invert some more Yoda conditions in the neighbourhood. | ||
| 7d109111 | 2020-01-20 10:29:31 | Make the code more readable by introducing symbolic constants for tagging priorities. This review also made me find a minor bug: do not upgrade TAG_FALLBACK to TAG_WEAK when there is trailing whitespace. | ||
| 92929bf6 | 2020-01-19 17:59:00 | Introduce a new mdoc(7) macro .Tg ("tag") to explicitly mark a place as defining a term. Please only use it when automatic tagging does not work. Manual page authors will not be required to add the new macro; using it remains optional. HTML output is still rudimentary in this version and will be polished later. Thanks to kn@ for reminding me that i have been considering since BSDCan 2014 whether something like this might be useful. Given that possibilities of making automatic tagging better are running out and there are still several situations where automatic tagging cannot do the job, i think the time is now ripe. Feedback and no objection from millert@; OK espie@ inoguchi@ kn@. | ||
| ea5923ab | 2020-01-19 16:16:32 | Align to the new, sane behaviour of the groff_mdoc(7) .Dd macro: without an argument, use the empty string, and always concatenate all arguments, no matter their number. This allows reducing the number of arguments of mandoc_normdate() and some other simplifications, at the same time polishing some error messages by adding the name of the macro in question. | ||
| ebc37634 | 2020-01-11 20:48:13 | When autogenerating one layout cell from a data cell just beyond the last layout cell that was explicitly specified, properly initialize the spacing attribute to indicate that the default is to be used. Failing to do so and leaving the spacing at zero in this case caused misformatting when another row further down the table had even more explicitly specified cells. Bug found while trying to write regression tests for tbl_term.c rev. 1.61. | ||
| 414e7448 | 2020-01-11 16:24:33 | Fix a logic error: When both the first and the third column are spans, do not use the number of columns of the span starting in column two for the span starting in column zero. With afl, Jan Schreiber <jes at posteo dot de> found cases where this caused NULL pointer accesses because too many layout cells were consumed. While here, make the code more similar at the three places that iterate over data cells. | ||
| e5c2e3c9 | 2020-01-11 16:02:48 | Print more tbl(7) details to help debugging: column numbers, options, layout rows, cell types, cell modifiers. | ||
| 7411869f | 2020-01-10 15:20:49 | autocapitalize=none; also from Tim Baumgard | ||
| b2aaade0 | 2020-01-10 12:53:50 | Switch off the useless and annoying "autocomplete" feature; issue reported by Tim Baumgard <at bmgrd dot com>. landry@ and florian@ agree with the general direction. | ||
| 0f5f5b53 | 2020-01-08 12:09:14 | Skip whitespace before tokens, too. Bug found by bentley@ with input like "delim $$ delim off". | ||
| 55ceb03d | 2020-01-07 11:15:12 | Improve the description of -m/-M/MANPATH/man.conf in multiple respects after kn@ reported that the descriptions were incomplete and somewhat inaccurate. OK jmc@ kn@ | ||
| ea3fff40 | 2019-12-31 22:49:17 | When all cells in a tbl(1) column are empty, set the column width to 1n rather than to 0n, in the same way as groff does. This fixes misformatting reported by bentley@ in xkeyboard-config(7). | ||
| b19021b2 | 2019-12-26 19:51:47 | Do not fail an assertion when a high level macro occurs in the body of a conditional inside a .ce request block. Instead, abort the .ce block just like when there is no conditional in between. Bug found by espie@ working on the textproc/fstrcmp port. | ||
| ac01d98f | 2019-12-10 10:49:04 | In HTML, display straight quotes, not curly quotes, for Qq/Qo/Qc macros. This is the intended behavior and already the case in terminal output. Incorrect output noticed by Eldred Habert. ok schwarze@ | ||
| 53459fdf | 2019-11-10 22:18:01 | Add a Content-Security-Policy HTTP header that allows only CSS. This ensures that in a modern browser that understands the header, mandoc rendering bugs cannot possibly be interpreted as JavaScript. ok schwarze@ | ||
| 67217f5c | 2019-11-09 14:39:42 | In the past, generating comment nodes stopped at the .TH or .Dd macro, which is usually close to the beginning of the file, right after the Copyright header comments. But espie@ found horrible input files in the textproc/fstrcmp port that generate lots of parse nodes before even getting to the header macro. In some formatters, comment nodes after some kinds of real content triggered assertions. So make sure generation of comment nodes stops once real content is encountered. | ||
| 18ccf011 | 2019-10-01 17:54:04 | For invalid queries and for valid queries returning no result, return the appropriate 40x status code rather than 200. Improvement suggested and diff tested by John Gardner <gardnerjohng at gmail dot com>. | ||
| e2edd184 | 2019-09-15 00:08:46 | Fix line breaking in no-fill mode (.Bd -unfilled/<pre>), which apparently didn't work since the .Pp/<p> reorg. The new logic is more similar to what the terminal formatter does: 1. Before a node that starts a new mdoc(7) input line, start a new HTML output line. 2. An empty input line or a .Pp causes an empty output line. 3. Nothing needs to be done at the end of a node. Severe misformatting was reported in table(5) by Edgar Pettijohn <edgar at pettijohn dash web dot com> on misc@. | ||
| 8dbab69b | 2019-09-13 19:18:48 | Improve validation of function names: 1. Relax checking to accept function types of the form "ret_type (fname)(args)" (suggested by Yuri Pankov <yuripv dot net>). 2. Tighten checking to require the closing parenthesis. | ||
| 87fbaedf | 2019-09-05 13:34:55 | Do not clear HTML_NOSPACE in print_indent(). I don't think there ever was a reason for doing so. Besides, there is a discrepacy with respect to the point in the document affected. That flag controls whitespace at the current formatting point. But when HTML_BUFFER is in effect, the line break and indentation is typically inserted one word further to the left. Anything happening at that point to the left can't reasonably influence spacing at the different point further to the right. Among other effects, this change avoids some spurious line breaks in HTML code at points where they weren't supposed to happen, line breaks that in some cases caused undesirable, visible whitespace when the resulting HTML was rendered. | ||
| 5847b48d | 2019-09-03 18:07:57 | Wrap text and phrasing elements in paragraphs unless already contained in flow containers; never put them directly into sections. This helps to format paragraphs with the CSS class selector .Pp. Suggested by bentley@ and also by Colin Watson <cjwatson at debian> via Michael Stapelberg <stapelberg at debian>, see https://github.com/Debian/debiman/issues/116 | ||
| faccc662 | 2019-09-03 15:09:39 | Format .Nd with more logically with <span> rather than <div>; after all, it is supposed to be a one-line description. For the case where .Nd generates flow content (which is very bad style but syntactically valid), rely on the new feature of html_close_paragraph() to close out the <span> prematurely, effectively moving the flow content out of the .Nd for HTML presentation. For the final closing, also rely on the new html_close_paragraph() functionality, this time triggered by the subsequent block, which will typically be .Sh SYNOPSIS. | ||
| f1a57f6e | 2019-09-03 12:30:34 | oops, fix use after free in previous | ||
| 1fdb7b23 | 2019-09-03 12:03:05 | Make html_close_paragraph() more versatile, more robust, less dependent on individual HTML elements, and simpler: don't just close <p>, <pre>, and <a>, but any element that establishes phrasing context. This doesn't change output for any OpenBSD manual page, but it will allow using this function more safely and at more places in the future. | ||
| c5914f85 | 2019-09-01 15:12:03 | delete the TAG_IDIV crutch, which is no longer used | ||
| 635fdded | 2019-08-29 17:57:25 | In the HTML formatter, assert(3) that no HTML nesting violation occurs. Tested on the complete manual page trees of Version 7 AT&T UNIX, 4.4BSD-Lite2, POSIX-2013, OpenBSD 2.2 to 6.5 and -current, FreeBSD 10.0 to 12.0, NetBSD 6.1.5 to 8.1, DragonFly 3.8.2 to 5.6.1, and Linux 4.05 to 5.02. | ||
| 90849764 | 2019-08-02 17:04:55 | minor sync of the inline stylesheet with mandoc.css: delete unimportant .Pp rule and shorten overly specific selectors | ||
| bc6b7f6f | 2019-07-28 19:41:01 | Simplification, no functional change: Delete the "argc" argument from fs_search() which is now always 1, and move error reporting to the main() program where it is more logically placed and easier to see. | ||
| 225b5963 | 2019-07-28 18:35:09 | There is no point in pledge(2)ing literally the same list twice, so delete the second copy. No functional change. | ||
| 9540818f | 2019-07-28 18:22:35 | In man(1) mode, do the search for each name independently, and show the results in the order of the command line arguments. Implemented by separating the code for man(1) and apropos(1) in the main() program. Surprisingly, the number of lines of code remains unchanged. Issue reported by deraadt@, additional input from millert@. | ||
| 73f693ef | 2019-07-28 13:12:58 | Improve structure, no functional change: Unify code to process one single input file and move it into a dedicated new function. | ||
| 6181cd34 | 2019-07-27 13:40:42 | Move two more output state variables into the new struct outstate. Also, move setting of tag_files.tagname into tag_init(). No functional change. | ||
| 3f735e33 | 2019-07-26 23:12:02 | Cleanup, no functional change: For clarity, stop storing the same information (in this case, -O settings) in two structs. Give the local struct in main.c a more descriptive name (output state). | ||
| d8e30e1d | 2019-07-26 21:03:16 | Structural cleanup, no functional change: Mixing parser and formatter state in the same struct was a bad idea, so pull the parser state and configuration out of it. This makes sure output options are not passed into parser functions and parser options are not passed into output functions. While here, add comments to the important local variables in main(). | ||
| 3cd418b7 | 2019-07-26 18:01:21 | Structural cleanup, no functional change: Move process group management out of main() into its own function because it has its own, self-contained logic and its own local variables. | ||
| 30e481c6 | 2019-07-23 17:42:14 | tagging support for .TP and .TQ; try e.g. man -O tag=commit cvs | ||
| 1e876328 | 2019-07-22 03:20:55 | Slowly start implementing tagging support for man(7) pages, even though it is obvious that this can never become as good as for mdoc(7) pages. As a first step, tag alphabetic arguments of .IP macros, which are often used for lists of options and keywords. Try "man -O tag=g as" to get the point. Thanks to Leah Neukirchen for recently reminding me that exploring how much can be done in this respect may be worthwhile: it is likely to slightly improve usability while adding only small amounts of relatively straightforward code. | ||
| ecf32ec4 | 2019-07-19 21:45:37 | #define a handful of constant strings to reduce the diff to -portable; now, the diff is about -30 +150 lines (about 0.4%) | ||
| 29912917 | 2019-07-19 20:25:21 | If no tags were generated at all, unlink(2) the empty tags file as soon the condition can be detected and do not pass it to less(1). This may happen for man(7) pages, for preformatted pages, and for very simple pages like true(1). The main benefit is that :t inside less(1) yields the clearer diagnostic message "No tags file" rather than the mildly confusing "No such tag in tags file": the latter might encourage further, futile attempts to jump to other tags. Improvement suggested by Leah Neukirchen <leah at vuxu dot org> from The Void. | ||
| aaa0a619 | 2019-07-15 21:40:28 | don't print the final heads-up about message when a search did not yield any manual pages to display; issue found with regress/usr.bin/mandoc/db/ | ||
| 16c326ec | 2019-07-14 18:14:27 | If messages are shown and output is printed without a pager, display a heads-up on stderr at the end because otherwise, users may easily miss the messages: because messages typically occur while parsing, they typically preceed the output. This is most useful with flag combinations like "-c -W all" but may also help in some unusual error scenarios. Inconvenient ordering of output originally pointed out by espie@ for the example situation that /tmp/ is not writeable. | ||
| ce7e376c | 2019-07-11 16:56:52 | When parsing a tab character that is not preceded by a space character on an .It -column line, args() sets the MDOC_PHRASEQL flag to Quote the Last word of the Phrase. Even if it turns out this quoting is not needed because the word is already quoted for other reasons, clear the flag at the end of parsing the phrase, such that the flag does not leak to the next phrase. This patch fixes the bug that the trailing Macro on a line of the form .It "word<tab>word" Ta word Macro<eol> was incorrectly considered quoted and hence not parsed. Bug found by Havard Eidnes (he@) with the NetBSD gettytab(5) manual page: https://gnats.netbsd.org/cgi-bin/query-pr-single.pl?number=54361 Reported via Thomas Klausner (wiz@). | ||
| ecd1ed85 | 2019-07-10 19:38:56 | Some time ago, i simplified mandoc_msg() such that it can be used everywhere and not only in the parsers. For more uniform messages, use it at more places instead of err(3), in particular in the main program. While here, integrate a few trivial functions called at exactly one place into the main option parser, and let a few more functions use the normal convention of returning 0 for success and -1 for error. | ||
| 1432e701 | 2019-07-10 12:48:08 | in man.cgi(8), disable -O toc by default; requested by deraadt@ | ||
| 8e8a9782 | 2019-07-03 16:33:06 | prevent mandoc from segfaulting if /tmp is not writable okay schwarze@ | ||
| c8dfc550 | 2019-07-01 22:43:03 | delete trailing whitespace and space-tab sequences; no code change; patch from Michal Nowak <mnowak at startmail dot com> who found these with git pbchk in the illumos tree | ||
| 0c0f292b | 2019-06-27 15:05:14 | Fix mandoc_normdate() and the way it is used. In the past, it could return NULL but the calling code wasn't prepared to handle that. Make sure it always returns an allocated string. While here, simplify the code by handling the "quick" attribute inside mandoc_normdate() rather than at multiple callsites. Triggered by deraadt@ pointing out that snprintf(3) error handling was incomplete in time2a(). | ||
| af29ff23 | 2019-06-27 12:19:39 | Improve "man -h" output. 1. For pages lacking a SYNOPSIS, show the NAME section rather than nothing. 2. Do not print a stray blank before the beginning of a SYNOPSIS. Both issues reported by, and patch OK'ed by, tb@. | ||
| 7514a273 | 2019-06-11 15:40:41 | Do not access a NULL pointer if a table contains a horizontal line next to a table line having fewer columns than the table as a whole. Bug found by Stephen Gregoratto <dev at sgregoratto dot me> with aerc-config(5). | ||
| 6236a0df | 2019-06-03 20:23:39 | Explicitly state that the cases in the inner switch in term_fill() are exhaustive. While there is no bug, being explicit has no downside is is potentially safer for the future. Michal Nowak <mnowak at startmail dot com> reported that gcc 4.4.4 and 7.4.0 on illumos throw -Wuninitialized false positives. | ||
| 0bb0865d | 2019-06-03 19:58:00 | Initialize the local variable "lastln" in mparse_buf_r(). While there is no bug, it logically makes sense given the meaning of the variable that lastln is NULL as long as firstln is NULL. Michal Nowak <mnowak at startmail dot com> reported that gcc 4.4.4 and 7.4.0 on illumos throw -Wuninitialized false positives. | ||
| 5fff9381 | 2019-06-03 19:50:31 | Initialize the local variable "act" in print_mdoc_node(). While there is no bug, it helps clarity, and it is also safer in this particular code because in case a bug gets introduced later, accessing a NULL pointer is less dangerous than accessing an uninitialized pointer. Michal Nowak <mnowak at startmail dot com> reported that gcc 4.4.4 and 7.4.0 on illumos throw -Wuninitialized false positives. | ||
| 9daec1c5 | 2019-06-02 16:50:46 | Support prefers-color-scheme: dark. The :visited rule was contributed by <Armin at Besirovic dot com>. Guidance and OK tj@. | ||
| ed9166dd | 2019-05-26 01:16:08 | use proper crossreferences | ||
| 0b2c8d3a | 2019-05-21 08:03:43 | Do not print the style message "missing date" when the date is given as "$Mdocdate$" without an actual date. That is the canonical way to write a new manual page and not bad style at all. Misleading message reported by kn@ on tech@. | ||
| b3006189 | 2019-05-11 07:18:14 | socppc makes an extended visit to the bigbucket. ok kettenis |