aboutsummaryrefslogtreecommitdiffstatshomepage
Commit message (Collapse)AuthorAgeFilesLines
...
* Delete the redundant "nchild" member of struct roff_node, replacingIngo Schwarze2016-01-0812-124/+120
| | | | | | | | 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.
* Prefer warn(3) over perror(3) at the few places where it was used.Ingo Schwarze2016-01-082-10/+10
| | | | | It is useful to see the program name, and we have err.h compat in place anyway. Suggested by Christos Zoulas (NetBSD).
* Simplify the mparse_open() interface.Ingo Schwarze2016-01-086-35/+27
| | | | | | Just return the file descriptor or -1 on error; there is just one kind of error anyway. Suggested by Christos Zoulas (NetBSD).
* It was very surprising that a function called mparse_readfd()Ingo Schwarze2016-01-085-11/+17
| | | | | | | | | | | | | 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).
* would be nice to warn about broken .Xr links...Ingo Schwarze2016-01-081-1/+6
|
* The root of an .EQ tree is always EQN_ROOT, never EQN_LIST,Ingo Schwarze2016-01-081-2/+2
| | | | | | 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.
* This code wasted memory by allocating sizeof(enum termfont *)Ingo Schwarze2016-01-071-2/+2
| | | | | where only sizeof(enum termfont) is needed. Fixes CID 1288941. From christos@ via wiz@, both at NetBSD.
* Recursive "define" was not detected because "lim" was neverIngo Schwarze2016-01-071-1/+2
| | | | | incremented, causing infinite loops. Fixing CID 1288962. From christos@ via wiz@, both at NetBSD.
* Improve handling of .Va and .Vt macros.Ingo Schwarze2016-01-041-14/+29
| | | | | | | 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.
* Generate simpler in-page links: just replace spaces with underscores.Ingo Schwarze2016-01-042-8/+6
| | | | Patch from bentley@.
* Don't retain the search query in the resulting manual links.Ingo Schwarze2016-01-041-56/+3
| | | | | Clean, simple URLs are best. Patch from bentley@.
* remove NULL-checks before free(); from mmcc@Ingo Schwarze2015-12-231-5/+3
|
* pledge(2) style:Ingo Schwarze2015-12-152-15/+23
| | | | | | | 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.
* No point in trying to go on when elementary database operationsIngo Schwarze2015-11-263-8/+24
| | | | | | 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@.
* Fix multiple issues regarding process group and signal mask handlingIngo Schwarze2015-11-203-26/+68
| | | | | found by tb@ and millert@; parts of the code, in particular in tag.c, by millert@; OK millert@.
* Fix an issue reported by deraadt@: When hitting Ctrl-Backslash (= SIGQUIT)Ingo Schwarze2015-11-141-5/+35
| | | | | | | | | | | | | | | 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@
* Simplify the logic in mandoc_normdate() and add some comments.Ingo Schwarze2015-11-121-16/+32
| | | | | | | | 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.
* Never use LC_ALL. On the one hand, it can cause misformatting.Ingo Schwarze2015-11-121-2/+10
| | | | | On the other hand, it is a security risk because it might cause buffer overflows. Use LC_CTYPE only, that's all we need.
* move compat_reallocarray.o into SOELIM_OBJS, no functional changeIngo Schwarze2015-11-071-3/+4
|
* soelim(1) use getline(3) and err(3), and err(3) uses getprogname(3);Ingo Schwarze2015-11-071-2/+6
| | | | found on Solaris 10 at OpenCSW
* The sh(1) "test" builtin on Solaris 10 doesn't have -e,Ingo Schwarze2015-11-071-3/+3
| | | | | even though that's required by POSIX. Use -w and -r, that's just as good.
* provide a simple stand-alone implementation of getline(3)Ingo Schwarze2015-11-075-2/+94
| | | | for systems lacking it
* Modernization, no functional change intended:Ingo Schwarze2015-11-0711-193/+97
| | | | | | Use the POSIX function getline(3) rather than the slightly dangerous BSD function fgetln(3). Remove the related compatibility code.
* Without HAVE_ERR, don't try to include <err.h>, it probably isn't there.Ingo Schwarze2015-11-0710-11/+28
| | | | | In that case, the required prototypes are in "config.h". Patch from Peter Bray <pdb_ml at yahoo dot com dot au>.
* In private header files, __BEGIN_DECLS and __END_DECLS are pointless.Ingo Schwarze2015-11-0723-97/+30
| | | | | | | | | | | | 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.
* garbage collect unused EXAMPLEDIR, forgotten in the CSS cleanup;Ingo Schwarze2015-11-073-7/+2
| | | | noticed by Peter Bray <pdb_ml at yahoo dot com dot au>
* Install the soelim(1) binary and manual to the right places.Ingo Schwarze2015-11-071-3/+5
| | | | Bug reported by Peter Bray <pdb_ml at yahoo dot com dot au>.
* In ./configure, select a RE syntax for word boundaries supported by libc;Ingo Schwarze2015-11-065-8/+67
| | | | issue reported by Svyatoslav Mishyn, Peter Bray, and Daniel Levai.
* merge pledge(2) support from OpenBSDIngo Schwarze2015-11-065-3/+56
|
* Use getprogname(3) rather than __progname.Ingo Schwarze2015-11-068-36/+81
| | | | | | | 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.
* Use include files "header.html" and "footer.html" rather than aIngo Schwarze2015-11-053-12/+28
| | | | | | | | | | | | | 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.
* Unify the three stylesheets into a single CSS file.Ingo Schwarze2015-11-057-156/+34
| | | | Many thanks to bentley@ for doing this work.
* demandoc(1) needs to link against -lutil, tooIngo Schwarze2015-11-051-2/+2
|
* remove a stray iso-latin-1 character; noticed by bentley@Ingo Schwarze2015-11-051-2/+2
|
* specify option ordering in the DESCRIPTION section;Ingo Schwarze2015-11-051-2/+7
| | | | from guenther@, ok and tweaks jmc@
* If a .Bd block has no arguments at all, drop the block and only keepIngo Schwarze2015-10-305-6/+26
| | | | | its contents. Removing a gratuitious difference to groff output found after a related bug report from krw@.
* Do not access a NULL pointer when a .Bd macro has no arguments at all.Ingo Schwarze2015-10-301-1/+4
| | | | Bug reported by krw@.
* apply bold and italic to all non-ASCII Unicode codepoints,Ingo Schwarze2015-10-231-2/+2
| | | | fixing input like \fB\('e; issue reported by bentley@
* use the new function man_validate() here, tooIngo Schwarze2015-10-224-6/+12
|
* move man(7) validation into the dedicated validation phase, tooIngo Schwarze2015-10-228-62/+70
|
* If no output device was allocated because no file wanted to produce output,Ingo Schwarze2015-10-221-16/+18
| | | | | refrain from dereferencing a NULL pointer during final deallocation. Fixing a recent regression reported by czarkoff@
* Move all mdoc(7) node validation done before child parsingIngo Schwarze2015-10-214-277/+249
| | | | | | 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.
* In order to become able to generate syntax tree nodes on the roff(7)Ingo Schwarze2015-10-2014-182/+393
| | | | | | | | 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.
* style cleanup, no functional changeIngo Schwarze2015-10-191-56/+59
|
* Simplify, no functional change:Ingo Schwarze2015-10-191-36/+52
| | | | Delete the outmdoc, outman, and outfree function pointers.
* including <ohash.h> requires including <stdint.h> beforehand;Ingo Schwarze2015-10-191-1/+2
| | | | noticed by Svyatoslav Mishyn <juef at openmailbox dot org>
* Very tricky diff to fix macro interpretation and spacing around tabsIngo Schwarze2015-10-174-45/+82
| | | | | | | | | | | | | | in .Bl -column; it took me more than a day to get this right. Triggered by a loosely related bug report from tim@. The lesson for you is: Use .Ta macros in .Bl -column, avoid tabs, or you are in for surprises: The last word before a tab is not interpreted as a macro (unless there is a blank in between), the first word after a tab isn't either (unless there is a blank in between), and a blank after a tab causes a leading blank in the respective output cell. Yes, "blank", "tab", "blank tab" and "tab blank" all have different semantics; if you write code relying on that, good luck maintaining it afterwards...
* Delete two preprocessor constants that are no longer used.Ingo Schwarze2015-10-152-7/+2
| | | | Patch from Michael Reed <m dot reed at mykolab dot com>.
* Simplify the part of args() that is handling .Bl -column phrases:Ingo Schwarze2015-10-151-73/+28
| | | | | | | | | | Delete manual "Ta" handling because macro handling should not be done in an argument parser but should be left to the macro parsers, which exist anyway and work well. No functional change, minus 40 lines of code. Confusing and redundant code found while investigating an old bug report from tim@.
* When blk_full() handles an .It line in .Bl -column and indirectlyIngo Schwarze2015-10-151-1/+6
| | | | | | | | calls phrase_ta() to handle a .Ta child macro, advance the body pointer accordingly, such that a subsequent tab character rewinds the right body block and doesn't fail an assertion. That happened when there was nothing between the .Ta and the tab character. Bug reported by tim@ some time ago.