summaryrefslogtreecommitdiff
path: root/usr.bin/mandoc
AgeCommit message (Collapse)Author
2016-04-15Fix parsing of PATH_INFO if both a section directory and anIngo Schwarze
architecture subdirectory are specified. Issue reported by tb@.
2016-04-15Make HTML tags lower case for better stylistic agreement with whatIngo Schwarze
html.c does.
2016-04-15In the architectures dropdown, move aviion, ia64, solbourne, and vaxIngo Schwarze
down to the currently unsupported entries.
2016-04-15If PATH_INFO contains a complete and correct path to a manual pageIngo Schwarze
file, for example "/OpenBSD-5.9/man2/pledge.2", no database query is needed and the file is delivered directly. But even in this case, let's parse the PATH_INFO and fill the query structure such that the search form at the top of the result page gets pre-filled with useful values.
2016-04-15omit list of other results one there is only one matchIngo Schwarze
2016-04-14for .Xr links, use short PATH_INFO style URIsIngo Schwarze
2016-04-14Fix a process group race.Ingo Schwarze
It could occasionally happen that the child process spawned less(1) before the parent process passed the control of the terminal to the child, and in that case, less(1) sometimes complained "Stopped (tty output)". Issue reported by naddy@.
2016-04-14do not rewrite short URIsIngo Schwarze
2016-04-13Give manuals in purely numerical sections priority over manuals ofIngo Schwarze
the same name in sections with an alphabetical suffix; same logic as in main.c rev. 1.171.
2016-04-13Give manuals in purely numerical sections priority over manuals ofIngo Schwarze
the same name in sections with an alphabetical suffix (on OpenBSD, mostly 3p), restoring behaviour of the traditional BSD man(1) that got lost in the switch to the mandoc-based implementation. Issue reported by jsg@, using an idea by mikeb@ for the solution, and at least afresh1@ and jasper@ also seem in favour of the direction.
2016-03-30for some time now mandoc has not required MLINKS to functionJason McIntyre
correctly - logically complete that now by removing MLINKS from base; authors need only to ensure there is an entry in NAME for any function/ util being added. MLINKS will still work, and remain for perl to ease upgrades; ok nicm (curses) bcook (ssl) ok schwarze, who provided a lot of feedback and assistance ok tb natano jung
2016-03-20" the the " -> " the ", or in a couple of cases replace the superfluousKenneth R Westerback
"the" with the obviously intended word. Started with a "the the" spotted by Mihal Mazurek.
2016-03-18double word;Jason McIntyre
2016-03-18Make the SCRIPT_NAME logic simpler, safer, and make it actually work;Ingo Schwarze
in part based on ideas by bentley@. While here, improve the documentation.
2016-03-18document short URIsIngo Schwarze
2016-03-17make man(1) mode the default rather than apropos(1) modeIngo Schwarze
2016-03-17support short URIs for man.openbsd.orgIngo Schwarze
2016-03-15'accomodate' -> 'accommodate' in comments.Kenneth R Westerback
Started by diff from Mical Mazurek.
2016-01-16Unbreak reading from stdin after recent parse() restructuring.Florian Obser
OK schwarze@
2016-01-08Delete the redundant "nchild" member of struct roff_node, replacingIngo Schwarze
most uses by one, a few by two pointer checks, and only one by a tiny loop - not only making data smaller, but code shorter as well. This gets rid of an implicit invariant that confused both static analysis tools and human auditors. No functional change.
2016-01-08Prefer warn(3) over perror(3) at the few places where it was used.Ingo Schwarze
It is useful to see the program name. Suggested by Christos Zoulas (NetBSD).
2016-01-08Simplify the mparse_open() interface.Ingo Schwarze
Just return the file descriptor or -1 on error; there is just one kind of error anyway. Suggested by Christos Zoulas (NetBSD).
2016-01-08It was very surprising that a function called mparse_readfd()Ingo Schwarze
closed the file descriptor passed to it after completing its work, in particular considering the fact that it required its callers to call open(2) or mparse_open() beforehand. Change mparse_readfd() to not call close(2) and change the callers to call close(2) afterwards, more or less bringing open and close to the same level of the code and making review easier. Note that man.cgi(8) already did that, even though it was wrong in the past. Small restructuring suggested by Christos Zoulas (NetBSD).
2016-01-08The root of an .EQ tree is always EQN_ROOT, never EQN_LIST,Ingo Schwarze
so delete a redundant NULL check that confused Coverity in CID 1257471; issue reported by wiz@, patch differs from what christos@ did in NetBSD. No functional change.
2016-01-07This code wasted memory by allocating sizeof(enum termfont *)Ingo Schwarze
where only sizeof(enum termfont) is needed. Fixes CID 1288941. From christos@ via wiz@, both at NetBSD.
2016-01-07Recursive "define" was not detected because "lim" was neverIngo Schwarze
incremented, causing infinite loops. Fixing CID 1288962. From christos@ via wiz@, both at NetBSD.
2016-01-04Improve handling of .Va and .Vt macros.Ingo Schwarze
tedu@ noticed that no Vt= database entries were generated. Serguey Parkhomovsky suggested the deletion of parse_mdoc_body(). tb@ noticed that the fix requires more than just adding TYPE_Vt to the MDOC_Vt mask in the mdoc_handler array.
2015-12-25Generate simpler in-page links: just replace spaces with underscores.Anthony J. Bentley
So http://example.com/OpenBSD-current/man1/ls.1#x546865204c6f6e6720466f726d6174 becomes http://example.com/OpenBSD-current/man1/ls.1#The_Long_Format ok schwarze@
2015-12-25Don't retain the search query in the resulting manual links.Anthony J. Bentley
Clean, simple URLs are best. ok schwarze@
2015-12-23remove NULL-checks before free()mmcc
2015-12-15pledge(2) style:Ingo Schwarze
Make sure to always use the idiom 'if (pledge("' such that it can easily be searched for. No functional change. Requested by deraadt@ some time ago.
2015-11-26No point in trying to go on when elementary database operationsIngo Schwarze
like preparing queries or binding variables fail; that won't yield useful results anyway but may generate huge pointless error messages. Issue reported by deraadt@.
2015-11-20Fix multiple issues regarding process group and signal mask handlingIngo Schwarze
found by tb@ and millert@; parts of the code, in particular in tag.c, by millert@; OK millert@.
2015-11-14Fix an issue reported by deraadt@: When hitting Ctrl-Backslash (= SIGQUIT)Ingo Schwarze
in the less(1) spawned by man(1), man(1) died uncleanly, leaving behind its temp files, and killed less(1) uncleanly as well with SIGPIPE, leaving the terminal in the wrong state. Fix this by giving less(1) its own process group and handing it control of the terminal, but in such a way that Ctrl-z (= SIGSTOP) still works: In that case, let man(1) stop itself, too, and let it continue the pager when it continues itself. Joint work with millert@ who contributed most of the expertise required, and also most parts of the code. OK deraadt@ millert@
2015-11-12Simplify the logic in mandoc_normdate() and add some comments.Ingo Schwarze
Also add a comment in time2a() explaining why it isn't possible to use just one single call to strftime(). Do some style cleanup while here. No functional change. Triggered by a very different patch from des@FreeBSD.
2015-11-12Never use LC_ALL. On the one hand, it can cause misformatting.Ingo Schwarze
On the other hand, it is a security risk because it might cause buffer overflows. Use LC_CTYPE only, that's all we need.
2015-11-07Modernization, no functional change intended:Ingo Schwarze
Use the POSIX function getline(3) rather than the slightly dangerous BSD function fgetln(3).
2015-11-07In private header files, __BEGIN_DECLS and __END_DECLS are pointless.Ingo Schwarze
Because these work slightly differently on different systems, they are becoming a maintenance burden in the portable version, so delete them. Besides, one of the chief design goals of the mandoc toolbox is to make sure that nothing related to documentation requires C++. Consequently, linking mandoc against any kind of C++ program would defeat the purpose and is not supported. I don't understand why kristaps@ added them in the first place.
2015-11-06correct exit status on pledge(2) errorsIngo Schwarze
2015-11-06Use getprogname(3) rather than __progname.Ingo Schwarze
Suggested by Joerg@ Sonnenberger (NetBSD). Last year, deraadt@ confirmed on tech@ that this "has the potential to be more portable", and micro-optimizing for speed is not relevant here. Also gets rid of one global variable.
2015-11-05Use include files "header.html" and "footer.html" rather than aIngo Schwarze
compiled-in string. This is not a security risk, we read the file manpath.conf from the same directory, anyway. No error handling is needed; even if the files are absent, that's not an error. This is more flexible without causing complication of the code or the user interface. It helps the upcoming revamp of the online manual pages on man.NetBSD.org. Based on an idea by Jean-Yves Migeon <jeanyves dot migeon at free dot fr>, but implemented in a much simpler way.
2015-11-05simplify: use one stylesheet rather than two; from bentley@Ingo Schwarze
2015-10-30If a .Bd block has no arguments at all, drop the block and only keepIngo Schwarze
its contents. Removing a gratuitious difference to groff output found after a related bug report from krw@.
2015-10-30Do not access a NULL pointer when a .Bd macro has no arguments at all.Ingo Schwarze
Bug reported by krw@.
2015-10-23apply bold and italic to all non-ASCII Unicode codepoints,Ingo Schwarze
fixing input like \fB\('e; issue reported by bentley@
2015-10-22use the new function man_validate() here, tooIngo Schwarze
2015-10-22move man(7) validation into the dedicated validation phase, tooIngo Schwarze
2015-10-22If no output device was allocated because no file wanted to produce output,Ingo Schwarze
refrain from dereferencing a NULL pointer during final deallocation. Fixing a recent regression reported by czarkoff@
2015-10-21Move all mdoc(7) node validation done before child parsingIngo Schwarze
to the new separate validation pass, except for a tiny bit needed by the parser which goes to the new mdoc_state() module; cleaner, simpler, and surprisingly also shorter by 15 lines.
2015-10-20In order to become able to generate syntax tree nodes on the roff(7)Ingo Schwarze
level, validation must be separated from parsing and rewinding. This first big step moves calling of the mdoc(7) post_*() functions out of the parser loop into their own mdoc_validate() pass, while using a new mdoc_state() module to make syntax tree state handling available to both the parser loop and the validation pass.