summaryrefslogtreecommitdiff
path: root/usr.bin/mandoc
AgeCommit message (Collapse)Author
2015-03-21when there is no -m, no -M, no MANPATH and no /etc/man.conf,Ingo Schwarze
fall back to /usr/share/man:/usr/X11R6/man:/usr/local/man
2015-03-20The .PD macro can occur in next-line scope. Fixes zshmisc(1).Ingo Schwarze
Issue reported by Christian Neukirchen <chneukirchen at gmail dot com>.
2015-03-20Simplify by almost halving the number of macro flags:Ingo Schwarze
1. MAN_EXPLICIT was used iff fp == blk_exp, so just test fp. 2. MAN_FSCOPED was used only for TP, so just test for TP. 3. MAN_NOCLOSE was completely unused. No functional change.
2015-03-18Convert -static -> ${STATIC} to make man.cgi static PIE.Pascal Stumpf
no concerns from schwarze@
2015-03-17Simplify: Now that rc is global anyway, no need to pass it aroundIngo Schwarze
as an argument. No functional change.
2015-03-17When the user exits the pager before the pager has drained all inputIngo Schwarze
from man(1), man(1) dies from SIGPIPE. Exiting man(1) is fine in this case, generating more output would be pointless, but without handling SIGPIPE, the exit code from man(1) was wrong and csh(1) printed an ugly message "Broken pipe". Fix this by handling SIGPIPE explicitly. Issue noticed by deraadt@.
2015-03-15Avoid off-by-one read access to the termacts array, which couldIngo Schwarze
sometimes result in missing line breaks before subsection headers. Found by carsten dot kunze at arcor dot de on SuSE 13.2.
2015-03-14Delete the separate and incomplete whatis(1) manualIngo Schwarze
and replace it by an MLINK to apropos(1), which already contains all information about whatis(1). "up to you" jmc@
2015-03-13no need for double macro; ok schwarzeJason McIntyre
2015-03-13Fix hardlink detection on platforms having padding in struct inodev,Ingo Schwarze
typically 64bit platforms. This was basically broken since forever. Not only is the padding used, but it was used uninitialized. Problem reported by jmc@.
2015-03-11When interpreting the -O argument as a macro name fails,Ingo Schwarze
fall back to showing Nd rather than not showing anything. Issue reported by jmc@.
2015-03-11Fix previous: size_t is often narrower than off_t.Ingo Schwarze
Cluestick applied by joerg at NetBSD.
2015-03-10The st_size member of struct stat is off_t, which is signed,Ingo Schwarze
all required by POSIX. So don't compare it against against an unsigned constant.
2015-03-10We can keep track of the pager PID without additional complexity.Ingo Schwarze
No functional change for now, but more robust in case anybody should ever add additional child processes.
2015-03-10Fix a regression caused in rev. 1.118, reported by kristaps@:Ingo Schwarze
When using a pager and the first manual shown is gzip'ed, the gunzip(1) process ended up as a child of the pager process such that the man(1) process couldn't wait for it, preventing proper display of the manual. Solve this by making the pager a child of the man(1) process (instead of the other way round), which requires being a bit more careful about properly closing file descriptors after use and waiting for the pager before exiting man(1).
2015-03-09Explicitly cast when assigning from char * to unsigned char * and vice versa.Ingo Schwarze
For example, gcc 4.7 wants this with -Wall. Patch from kristaps@.
2015-03-09Fix vertical spacing at the beginning of tables.Ingo Schwarze
man(7) always prints a blank line, mdoc(7) doesn't. Problem in mdoc(7) reported by kristaps@. mdoc(7) part of the patch tested by kristaps@.
2015-03-09In mdoc(7), don't mistreat negative .sp arguments as large positive ones.Ingo Schwarze
Instead, use the same logic as for man(7).
2015-03-09prevent the skipvsp flag from creeping past actual textIngo Schwarze
2015-03-09Flush the line preceding a table before clearing the right margin,Ingo Schwarze
such that that line isn't output with unlimited width. Problem reported and fix OK by kristaps@.
2015-03-03In eqn, "prime" is equivalent to \(fm, and - is equivalent to \(mi.Anthony J. Bentley
ok schwarze@
2015-03-03If an eqn(7) starts on a new input line, be sure to output whitespaceIngo Schwarze
in front of it. Issue found by tedu@ in glOrtho(3). There are also cases of excessive whitespace before and after equations. This patch neither fixes them nor makes them worse.
2015-03-02If a non-gz manual is read after a gzipped manual, refrainIngo Schwarze
from throwing a bogus error "wait: No child processes". As reported by Baptiste Daroussin <bapt at FreeBSD dot org>, clearing the state variable curp->child after use was forgotten.
2015-02-27When makewhatis(8) scans a tree, ignore trailing garbage on filenames.Ingo Schwarze
This is relevant because some ports install files like man1/xsel.1x, as reported by patrick keshishian <pkeshish at gmail dot com> on misc@. We can probably improve functionality and simplify the code by ignoring file name extensions altogether; we already know the section number from the name of the directory. But so close to lock, i'm keeping the fix minimal.
2015-02-27When man(1) and apropos(1) look for a file man1/foo.1 but it's unavailable,Ingo Schwarze
fall back to glob(man1/foo.*), which is more like what old man(1) did. Do this both for file names from the database and for fs_lookup(). This is relevant because some ports install files like man1/xset.1x. Regression reported by patrick keshishian <pkeshish at gmail dot com>.
2015-02-23oops, in NAME, don't nag about the comma after .NmIngo Schwarze
2015-02-23improve NAME section diagnostics;Ingo Schwarze
confusing messages reported by Jan Stary <hans at stare dot cz>
2015-02-21Escape quotes when expanding macro arguments.Ingo Schwarze
This fixes a bug naddy@ found in plan9/rc(1).
2015-02-20For selecting a two-digit font size, support the historic syntax \s12Ingo Schwarze
in addition to the classic syntax \s(12, the modern syntax \s[12], and the alternative syntax \s'12'. The historic syntax only works for the font sizes 10-39. Real-world usage found by naddy@ in plan9/rc.
2015-02-20Completely delete all carriage return characters from the input.Ingo Schwarze
No change to messages about them (ignore them right before line feeds, report errors elsewhere). naddy@ found a manual in the wild containing lots of these (ysm(1)), and i can't imagine a situation where dropping them could be problematic.
2015-02-17Render \(lq and \(rq as '"' in -Tascii mode but leave the renderingIngo Schwarze
of .Do/.Dc, .Dq, .Lb, and .St untouched. Reduces groff-mandoc differences in base by about 7%. Reminded of the issue by naddy@.
2015-02-17Cope with another one of the many kinds of DocBook stupidity:Ingo Schwarze
Instead of just using .br, DocBook sometimes fiddles with the utterly unportable internal register \n[an-break-flag] that is only available in the GNU implementation of man(7) and then arms an input line trap to call the equally unportable internal macro .an-trap that, in the GNU implementation, inspects that variable; all the world is GNU, isn't it? Since naddy@ reports that quite a few ports manuals suffer from this insanity, let's just translate it to the intended .br. Et ceterum censeo DocBookem esse delendam.
2015-02-17Let .it accept numerical expressions, not just numerical constants.Ingo Schwarze
For .it, ignore scaling units in roff_getnum(). Inside parentheses, skip whitespace after a sign in roff_getnum(). Parse and ignore unary plus in roff_getnum(). As a bonus, get rid of the only call to mandoc_strntoi() in roff.c.
2015-02-16clean up post_dt() validation function;Ingo Schwarze
improved diagnostics, minus six lines of code
2015-02-16Delete the -V option. It serves no purpose but keeps confusing people.Ingo Schwarze
2015-02-16Clamp width and indent settings to sensible values. Ignore errors for now.Ted Unangst
ok schwarze
2015-02-14shut up about tabs in SYNOPSIS .Fd lines, there is no good way to avoid themIngo Schwarze
2015-02-12Do not confuse .Bl -column lists that just broken another blockIngo Schwarze
with newly opened .Bl -column lists; fixing an assertion failure jsg@ found with afl: test case #481, Bl It Bl -column It Bd El text text El
2015-02-12Delete the mdoc_node.pending pointer and the function calculatingIngo Schwarze
it, make_pending(), which was the most difficult function of the whole mdoc(7) parser. After almost five years of maintaining this hellhole, i just noticed the pointer isn't needed after all. Blocks are always rewound in the reverse order they were opened; that even holds for broken blocks. Consequently, it is sufficient to just mark broken blogs with the flag MDOC_BROKEN and breaking blocks with the flag MDOC_ENDED. When rewinding, instead of iterating the pending pointers, just iterate from each broken block to its parents, rewinding all that are MDOC_ENDED and stopping after processing the first ancestor that it not MDOC_BROKEN. For ENDBODY markers, use the mdoc_node.body pointer in place of the former mdoc_node.pending. This also fixes an assertion failure found by jsg@ with afl, test case #467 (Bo Bl It Bd Bc It), where (surprise surprise) the pending pointer got corrupted. Improved functionality, minus one function, minus one struct field, minus 50 lines of code.
2015-02-11do not access a NULL pointer if an .Eo block lacks a tail;Ingo Schwarze
found by jsg@ with afl, test case #16
2015-02-11explicit blocks close out .Nd; fixing data structure corruptionIngo Schwarze
eventually leading to NULL pointer access; found by jsg@ with afl, text case #455.
2015-02-10Be more careful to not generate empty .In, .St, and .Xr nodes.Ingo Schwarze
That could happen when their first argument was another called macro, causing a NULL pointer access in .St validation found by jsg@ with afl. Make in_line_argn() easier to understand by using one state variable rather than two.
2015-02-10Do not read past the end of the buffer if an "f" layout font modifierIngo Schwarze
is followed by the end of the input line instead of a font specifier. Found by jsg@ with afl, test case #591. While here, improve functionality as well: * There is no "r" font modifier. * Font specifiers (as opposed to font modifiers) are case sensitive. * One-character font specifiers require trailing whitespace. * Ignore parenthised and two-letter font specifiers.
2015-02-10trim trailing white space, no code change;Ingo Schwarze
from Svyatoslav Mishyn <juef at openmailboxd dot org>, Crux Linux
2015-02-10Explain all WARNING, ERROR, and UNSUPP messages in the DIAGNOSTICS section.Ingo Schwarze
Feedback provided by jmc@ some time ago helped me to get this much more concise than my initial attempt. "i'm fine with it going in" jmc@
2015-02-07Closing a block validates it, which may end up deleting it,Ingo Schwarze
so if we are in a loop over blocks, cleanly restart the loop rather than risking use after free; found by jsg@ with afl.
2015-02-07be more careful about argc == 0Ingo Schwarze
2015-02-06replace the last legacy generic message type, "argument count wrong",Ingo Schwarze
by more specific messages, improving diagnostics for .cc .tr .Bl -column
2015-02-06better error reporting regarding .OP .RS .UR .TH argumentsIngo Schwarze
2015-02-06better diagnostics about excess arguments to .PD .ft .spIngo Schwarze