summaryrefslogtreecommitdiff
path: root/usr.bin/mandoc
AgeCommit message (Collapse)Author
2016-09-01remove "sparc" from a commentIngo Schwarze
2016-09-01move "sparc" down to discontinued architecturesIngo Schwarze
2016-08-30When the database is corrupt in the sense of containing invalidIngo Schwarze
pointers in the pages table, do not access NULL pointers, but gracefully handle the errors. Similar patches will be needed for the macro tables, too. <attila at stalphonsos dot com> audited the code and pointed out to me that dbm_get() can return NULL for corrupted databases, but that isn't handled properly at various places.
2016-08-30less confusing warning message about negative offsetsIngo Schwarze
2016-08-28If a line inside .Bl -column starts with a tab characterIngo Schwarze
and there was no preceding .It macro, do not read the byte before the beginning of the line buffer. Found by tb@ with afl@.
2016-08-22When trying to edit an existing database with makewhatis(8) -d or -uIngo Schwarze
but reading the database fails, report the full path to the database on standard error, and mention that the database is automatically recreated from scratch. Suggested by espie@.
2016-08-22When running into a mandoc.db(5) file still using the obsoleteIngo Schwarze
format based on SQLite 3, say so in words that mortals can understand rather than babbling about hex magic. Suggested by espie@.
2016-08-20When a mismatching end macro occurs while at least two nested blocksIngo Schwarze
are open, all except the innermost open block got a bogus MDOC_ENDED marker, in some situations triggering segfaults down the road which tb@ found with afl(1). Fix the logic error by figuring out up front whether an end macro has a matching body, and if it hasn't, don't mark any blocks as broken.
2016-08-20When scanning upwards for a column list to put a .Ta macro in,Ingo Schwarze
ignore body end markers of lists breaking other blocks. Fixing a logical error that caused a NULL deref found by tb@ with afl(1).
2016-08-20If a column list starts with implicit rows (that is, rows without .It)Ingo Schwarze
and roff-level nodes (e.g. tbl or eqn) follow, don't run into an assertion. Instead, wrap the roff-level nodes in their own row. Issue found by tb@ with afl(1).
2016-08-18fix an fd leakJonathan Gray
ok schwarze@
2016-08-17When the content of a manual page does not specify a section, theIngo Schwarze
empty string got added to the list of sections, breaking the database format slightly and causing the page to not be considered part of any section, not even if a section could be deduced from the directory or from the file name. Bug found due to the bogus pcredemo(3) "manual" in the pcre-8.38p0 package.
2016-08-17When reading back a mandoc.db(5) file in order to apply incrementalIngo Schwarze
changes, do not prepend a stray NAME_FILE (0x10) byte to the first names of pages. Bug found while investigating another issue reported by sthen@.
2016-08-17Make sure manuals in architecture-independent directories are treatedIngo Schwarze
as architecture-independent even if they abuse the third (architecture) argument of the .Dt macro for random stuff like "freetds reference manual". While the .Dt syntax is not the same as the .TH syntax in man(7), punishing offenders by treating them as architecture-dependent and hence completely excluding them from searches is too severe. Problem reported by sthen@.
2016-08-13Even after switching from a pending head to the body, we have toIngo Schwarze
continue scanning upwards, because the enclosing block might already be pending as well, e.g. .Bl .Bl .It Bo .El .It. Tree corruption leading to a later NULL deref found by tb@ with afl(1).
2016-08-11oops, fix stupid typo in previousIngo Schwarze
2016-08-11If a .Bd display is on the one hand doomed to be deleted becauseIngo Schwarze
it has no type, but is on the other hand breaking another block, delete its end marker as well, or the end marker may remain behind as an orphan, triggering an assertion in the terminal formatter. Problem found by tb@ with afl(1).
2016-08-10Don't deref NULL if the only child of the first .Sh is an emptyIngo Schwarze
in-line macro, and don't printf("%s", NULL) if the first child of the first .Sh is a macro; again found by tb@ with afl(1). (No, you should never use macros in any .Sh at all, please.)
2016-08-10move armish and hppa64 down in the dropdown box; reminded by jmc@Ingo Schwarze
2016-08-10Don't printf("%s", NULL) if .It has a macro as an argumentIngo Schwarze
in a list of a type where items don't takes arguments. Issue found by tb@ with afl(1).
2016-08-10When validating a .Bl list that defaults to -item for want of a type,Ingo Schwarze
don't let a subsequent -width access mdoc_argnames[] out of bounds. Found by tb@ with afl(1).
2016-08-10Fix assertion failures caused by whitespace inside \o'' (overstrike)Ingo Schwarze
sequences that jsg@ found with afl(1): * Avoid writing \t\b in term.c. * Handle trailing \b in term_ps.c.
2016-08-09fix printf("%s", NULL);Ingo Schwarze
found while investigating an unrelated bug report from jsg@
2016-08-05missing <endian.h> reported by Bapt@iste Daroussin, found on FreeBSDIngo Schwarze
2016-08-05fix a typo that prevented names from .Dt from getting priority overIngo Schwarze
names from .Sh NAME; no dire consequences on OpenBSD since we no longer have MLINKS for mdoc(7) pages
2016-08-04Fix an assertion failure that happened when trying to add a pageIngo Schwarze
with makewhatis -d to a completely empty database. Reported by Mark Patruck <mark at wrapped dot cx>, thanks!
2016-08-01Repair makewhatis -t, sorry for breaking it in the previous commit.Ingo Schwarze
Committing this quickly because it hurts package builders. Regression reported by naddy@.
2016-08-01Remove the dependency on SQLite without loss of functionality.Ingo Schwarze
Drop the obsolete names_check() now that we deleted MLINKS. Run "doas makewhatis" after compiling and installing this. Earlier version tested by jmc@ and jturner@; "commit it all" deraadt@ "commit and dodge" krw@
2016-07-31Some base system pages, for example perl(1), contain non-ASCIIIngo Schwarze
characters in their source code, so switch on charset autodetection in the same way as in man(1) itself. Issue reported by Pavan Maddamsetti at gmail dot com on bugs@.
2016-07-20tag_signal() is dead; from LLVM via Christos ZoulasIngo Schwarze
2016-07-19Since the mdoc/man parser unification, the parser is always allocatedIngo Schwarze
in mparse_alloc(), so delete all the curp->man == NULL checks. Triggered by a patch from Christos Zoulas suggesting to add yet another such check.
2016-07-19Use __attribute__((__format__ throughout.Ingo Schwarze
Triggered by a smaller patch from Christos Zoulas.
2016-07-15To remove the const qualifier from a pointer to an object - eitherIngo Schwarze
because we know it is actually mutable or because we are passing it to a function that doesn't accept a const object but won't actually attempt to modify it - simply casting from (const type *) to (type *) is legal C and clearly expresses the intent. So get rid of the obfuscating UNCONST macro. Basic idea discussed with guenther@.
2016-07-15Fix previous: the mandocdb() prototype was already there, it justIngo Schwarze
hid among static functions, as noticed by tedu@ (my bad).
2016-07-15add missing prototypes, no code change;Ingo Schwarze
noticed by Christos Zoulas with -Wmissing-prototypes
2016-07-11Make all components of the URI individually optional,Ingo Schwarze
independent of each other, as in: http://man.openbsd.org[/manpath][/mansec][/arch]/name[.sec] The restrictions in the past kept confusing people. Triggered by a question from RafaelNeves at gmail dot com.
2016-07-10Fix a nasty typo that prevented .so links to gziped manualsIngo Schwarze
from working in the absence of a mandoc.db(5) database. Found the hard way by Svyatoslav Mishyn on Crux Linux.
2016-07-10Simplify the code and the server setup by deleting the pseudo-manpathIngo Schwarze
"mandoc" that was used for man.cgi(8) documentation and by assuming that the apropos(1) and man.cgi(8) manuals are simply installed in the default manpath. Even though man.cgi(8) is not installed by default when installing OpenBSD, it is easy to copy it into the default manpath used for man.cgi(8). Idea found when considering a question asked by wrant dot com.
2016-07-09Do not treat PATH_INFO as a complete path if it doesn't containIngo Schwarze
a manpath. For example, this makes http://man.openbsd.org/mandoc work as expected. Bug reported by tb@, reminded by Svyatoslav Mishyn.
2016-07-09getopt(3) is declared in <unistd.h>, and <getopt.h> is not needed;Ingo Schwarze
from Joerg Sonnenberger via Thomas Klausner, NetBSD.
2016-07-08ISO C99 7.19.2.5 doesn't like mixing putchar(3) and putwchar(3) onIngo Schwarze
the same stream, and actually, it fails spectacularly on glibc. Portability issue pointed out by Svyatoslav Mishyn <juef at openmailbox dot org> after testing on Void Linux.
2016-07-08POSIX requires that a process calling tcsetpgrp(3) from the backgroundIngo Schwarze
gets a SIGTTOU signal. In that case, do not stop. Portability issue found while testing on commercial Solaris 9/10/11. Thanks to opencsw.org for providing me with a testing environment.
2016-07-07sync with mdocml.bsd.lv: mention httpd(8) and slowcgi(8)Ingo Schwarze
2016-07-01Update and simplify the documentation of the -s option,Ingo Schwarze
which was forgotten when implementing the new man.conf(5) format. The outdated information was originally pointed out by Andy Bradford <amb dash openbsd at bradfords dot org> on misc@. OK jmc@
2016-05-28Simplify search form: minus two visible control elements, minusIngo Schwarze
one table, minus twenty lines of code, no loss of functionality. No idea why i didn't do this earlier...
2016-05-23Trim trailing whitespace from man.conf lines. OK schwarze@.Todd C. Miller
2016-04-29Only focus on the query input box when no manual page is displayed,Ingo Schwarze
that is, for the index page, for the noresult page, and for the result of an apropos(1) query with more than one page. As noted by bentley@, when a manual page is displayed, it is more important that people can quickly use the space bar for paging and Ctrl-F for searching.
2016-04-28Set the "autofocus" attribute on the query text box.Ingo Schwarze
Patch from Fabian dot Raetz at gmail dot com.
2016-04-15Rename five static functions to make the classification of functionsIngo Schwarze
as parsers, page generators, and result generators more obvious. No functional change.
2016-04-15prefer warn[x](3) over fprintf(3) where appropriateIngo Schwarze