aboutsummaryrefslogtreecommitdiffstatshomepage
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix typo in filenames: mandocdb.{db,index} -> mandoc.{db,index}Ingo Schwarze2013-09-182-2/+64
|
* Merge OpenBSD revision 1.17:Ingo Schwarze2013-09-171-24/+70
| | | | | Without arguments, show the usage line and EXIT_FAILURE. Resolve some gratuitious differences (order, parantheses, white space, etc).
* Merge OpenBSD rev. 1.43:Ingo Schwarze2013-09-171-5/+5
| | | | | Kristaps changed the size member of struct manpaths from int to size_t. No functional change.
* Merge OpenBSD rev. 1.34.Ingo Schwarze2013-09-171-13/+52
| | | | | Do not truncate the production database when starting to build a new one. Suggested by deraadt@.
* merge OpenBSD rev. 1.41:Ingo Schwarze2013-09-171-92/+137
| | | | backout non-portable code
* Similar to rev. 1.58:Ingo Schwarze2013-09-171-1601/+1433
| | | | Consistently use the PATH_MAX since it is specified by POSIX.
* 1) Revert the argument names in the SYNOPSIS back to the usual ones.Ingo Schwarze2013-09-171-0/+171
| | | | | 2) For citing the names and email addresses of authors, consistently use the style ".An name Aq Mt email".
* Merge rev. 1.21:Ingo Schwarze2013-09-171-3/+2
| | | | | For citing the names and email addresses of authors, consistently use the style ".An name Aq Mt email".
* Merge rev. 1.20:Ingo Schwarze2013-09-171-45/+92
| | | | Revert the argument names in the SYNOPSIS back to the usual ones.
* use the .Bx macro; from Jan Stary via jmc@Ingo Schwarze2013-09-161-3/+4
|
* two improvements in the SYNOPSIS;Ingo Schwarze2013-09-161-4/+3
| | | | from Sascha Wildner <swildner at gmail dot com> (DragonFly)
* Drop .Ud remark, it has started to slowly turn into a lie.Ingo Schwarze2013-09-161-9/+2
|
* Beagle has been replaced by armv7; from patrick@.Ingo Schwarze2013-09-161-2/+2
|
* One of the WARNING messages has to use the word "section" twice in twoIngo Schwarze2013-09-163-6/+7
| | | | | | | | | | different meanings, that cannot be helped. But we can make this less confusing by stating that the second instance refers to stuff like (2), (3), and (9), and by adding the sections header the first instance refers to, for example ERRORS or RETURN VALUES. Source for confusion noticed by Jan Stary <hans at stare dot cz>, better wording suggested by jmc@, tweaked by me.
* Use normal line macro recognition, do not attempt to roll your own.Ingo Schwarze2013-09-151-4/+3
| | | | | This fixes horizontal spacing when an Ns macro follows a block-closing macro and the corresponding block-opening macro is not on the same line.
* Block closing macros do not allocate a new node but finish an existingIngo Schwarze2013-09-151-1/+4
| | | | | | | | | | one, so they miss the clearing of MDOC_NEWLINE in mdoc.c, node_alloc(). Consequently, MDOC_NEWLINE must be cleared before processing the next macro on the same line. This fixes horizontal spacing for input lines beginning like .Oc Ns ... Issue found by Franco Fichtner <franco at lastsummer dot de> while working on DragonFly mandoc integration.
* For some mdoc(7) macros, it is (unfortunately) semantically significantIngo Schwarze2013-09-151-3/+6
| | | | | | whether they are the first macro on the line or called by another macro. To help debugging, indicate this property "first macro on a new input line" by prefixing an asterisk to the line number in -Ttree output.
* Move the last column-counting members of struct termp (col and maxcols)Ingo Schwarze2013-08-212-22/+18
| | | | | | | | | from int to size_t, to match some existing ones (offset, *rmargin, viscol). Move some related local variables from int to size_t as well. Needed as a preparation to make a generalized adjbuf() function available beyond the file term.c, i.e. in mandoc.c. Also saves a couple of ugly casts.
* Use text production macros to document themselves.Ingo Schwarze2013-08-141-7/+17
| | | | | | Part of the patch was sent in by Jan Stary <hans at stare dot cz>, another part was added by jmc@, the rest was added by myself; ok jmc@.
* Implement the roff(7) font-escape sequence \f(BI "bold+italic".Ingo Schwarze2013-08-087-55/+90
| | | | | This improves the formatting of about 40 base manuals and reduces groff-mandoc formatting differences in base by about 5%.
* After a leading blank on an output line, the first word was counted twiceIngo Schwarze2013-08-051-2/+2
| | | | | | | | | | | against vend, causing a premature line break. Fix that bug by reverting revision 1.93 which Kristaps committed four years ago. Kristaps patch is no longer needed because the code below /* Write out the [remaining] word. */ now handles leading blanks correctly, probably already for a long time. This avoids premature line breaks in about a dozen base system manuals, for example as(1) and gdb(1), and alignment issues in another twenty, for example mount(2), ip6(4), pfctl(8), and crypto(9).
* Put .%C before .%D in .Rs outputIngo Schwarze2013-08-051-3/+3
| | | | | | | because that's the usual order in formal citations. My patch that was accepted into groff by Werner Lemberg uses the same order, so keep groff and mandoc consistent.
* jca@ found .as .shift .while in ratpoison(1)Ingo Schwarze2013-07-141-1/+7
|
* tedu@ says: "whatis pool" doesn't workIngo Schwarze2013-07-141-1/+10
|
* For citing the names and email addresses of authors,Ingo Schwarze2013-07-1313-56/+42
| | | | | | | consistently use the style ".An name Aq Mt email". Triggered by a question from Jan Stary <hans at stare dot cz>, ok jmc@.
* Rudimentary implementation of the .it request (input line trap).Ingo Schwarze2013-07-134-19/+64
| | | | | | | | | | As with any low-level roff request involving subtle interactions with macro internals, this implementation is not exact, but it does handle the simplest cases. This request occurs in man(7) code generated from DocBook, for example mysql(1) and yasm_arch(7). Thanks to brad@ for reporting the issue back in January 2011.
* Simple partial sync with OpenBSD:Ingo Schwarze2013-07-052-17/+17
| | | | | | | * Again accept suffixes on the name of the whatis utility. * The usage line for whatis must not invite expressions. * Revert the argument names in the SYNOPSIS back to the usual ones. * Revert a few gratuitious changes regarding line breaks etc.
* For the strings table, ohash_init is only called in ofmerge(),Ingo Schwarze2013-07-021-17/+16
| | | | | so move the str_info structure into that function. No functional change.
* Turning off synchronous mode logically belongs to opening the database,Ingo Schwarze2013-07-021-10/+12
| | | | so move the statement into the function dbopen().
* fixed in mandoc.c rev. 1.67 and OpenBSD mandoc.c rev. 1.36Ingo Schwarze2013-07-021-9/+1
|
* Restore the check whether each page added to the databaseIngo Schwarze2013-07-021-19/+87
| | | | | is actually reachable by man(1). This check got lost when the database backend was changed from Berkeley to sqlite.
* Parse for the closing delimiter `\}' for conditionalsIngo Schwarze2013-06-271-44/+32
| | | | | | | | | | | even when the conditional evaluated to false. While here, reshuffle the code to reduce indentation and make it more readable; that way, we can even trim down the comments because it becomes obvious what the code does. Found in zipinfo(1) - thanks to espie@ and naddy@ for making me look at that manual page.
* sort missing roff requests, and add some usage infoIngo Schwarze2013-06-221-5/+13
|
* A very simple utility script to automatically compare groff and mandocIngo Schwarze2013-06-221-0/+35
| | | | | | | output on collections of manual source files. I'm using this for quite some time now, and it has proven to be rather useful. Obviously, this will not be installed on user's systems.
* Improve handling of the roff(7) "\t" escape sequence:Ingo Schwarze2013-06-203-9/+28
| | | | | | | | | | | * Parsing macro arguments has to be done in copy mode, which implies replacing "\t" by a literal tab character. * Otherwise, render "\t" as the empty string, not as a 't' character. This fixes formatting of the distfile example in the oldrdist(1) manual. This also shows up in the unzip(1) manual as one of several issues preventing the removal of USE_GROFF from the archivers/unzip port. Thanks to espie@ for attracting my attention to the unzip(1) manual.
* Add .St values for POSIX 1003.1d, 1003.1j, and 1003.1q.Ingo Schwarze2013-06-192-14/+23
| | | | | | | Tweak descriptions of the other POSIX 1003.1<letter> standards. Sort a few others into their proper places. From Philip Guenther@ during t2k13.
* The mdoc_handler flags are unused and will never be used.Ingo Schwarze2013-06-071-127/+124
| | | | | Having a mask is sufficient to trigger putmdockey. Simplify by dropping the flags; no functional change.
* In .Xr database entries, mention the manual section again;Ingo Schwarze2013-06-071-3/+14
| | | | | the section was dropped when switching from db to sqlite. Use the customary format foo(N).
* The string hash table is only needed to combine multiple occurencesIngo Schwarze2013-06-071-110/+68
| | | | | | | | | | | | | | | | | | | | | | of the same string within the same manual, so initialize and purge it for each manual in ofmerge() instead of one single time in main(). There is no point in saving manual names and descriptions in that table because each of them occurs only once, or very few times. The is no point in saving section numbers there because they are so much shorter than the descriptions. Testing with the complete tree /usr/share/man/ on my notebook shows that this change slightly reduces memory consumption by about 20% while there is no measurable difference in execution time. As a bonus, this allows to delete the functions stradd() and stradds(), the "next" member from struct str, and the global struct str *words. While adapting the places in the code using stradd(), i noticed that parsing of the mdoc(7) .Nd macro was completely broken and that for formatted manual pages with unusable NAME section, the description was never set in the struct of. This commit fixes both bugs as well.
* Optimize stradds() and putkeys() to not call ohash_qlookupi()Ingo Schwarze2013-06-061-45/+28
| | | | | | | and ohash_find() twice. As a bonus, this allows to drop hashget(). While here, rename index to slot to match the terminology in the ohash manual; it also prevents potential clashes with index(3). Drop the slot variable altogether where it is used only once.
* Drop wordaddbuf() which is identical to putkeys().Ingo Schwarze2013-06-061-22/+9
| | | | | Also rename straddbuf() to stradds() to be more similar to putkeys(). Just cleanup, no functional change.
* In dbopen(), check success of remove("mandoc.db~").Ingo Schwarze2013-06-061-22/+15
| | | | | While here, simplify dbopen() and dbclose(): No need for strlcpy() and strlcat() when dealing with constant strings only.
* No point in inventing yet another file name for the database.Ingo Schwarze2013-06-061-2/+2
| | | | | | We are not going back to Berkeley DB and don't care about overwriting any obsolete files that may be lying around. So, go back from "mandocdb.db" to "mandoc.db".
* In parse_catpage(), the comment saying that the filename would beIngo Schwarze2013-06-061-1/+2
| | | | | | used as a default page description if no usable NAME section was found was preserved when moving from db to sqlite, but the code line actually doing that was removed without replacement. So, put it back.
* The return value from parse_man() is completely unused,Ingo Schwarze2013-06-051-14/+10
| | | | so make the function void; no functional change.
* Two sanity checks got lost in treescan()Ingo Schwarze2013-06-051-30/+37
| | | | | | | | | during the switch from db to sqlite; restore these: * Warn and skip when directory and file name mismatch. * Warn and skip when finding special files. * Warning about "mandocdb.db" is useless, it is always present. * While here, do not hardcode "mandocdb.db", use MANDOC_DB.
* Add back the realpath() checks that got lost during the change fromIngo Schwarze2013-06-051-122/+160
| | | | | | | | | | | | | | | | | | db to sqlite; they are needed to prevent corruption of the database when paths containing dot, dotdot, or symlinks are given on the command line. Also make sure the exit-code is really non-zero on system errors and use mandoc(1) exit codes. To make all this simpler, * Drop the "basedir" argument from almost every function and make it global because it is really state info used all over the place. * Move "startdir" and "fd" as local vars into set_basedir() because they are only used for this one purpose, i.e. to move out of basedir again. While here, * Clarify the name of path_arg in the main program; in the -C case, it is not a dir, and anyway there are lots of different dirs around. * Include missing <stdio.h> needed for perror().
* Some places used PATH_MAX from <limits.h>, some MAXPATHLEN from <sys/param.h>.Ingo Schwarze2013-06-056-55/+49
| | | | | | Consistently use the PATH_MAX since it is specified by POSIX, while MAXPATHLEN is not. In preparation for using this at a few more places.
* Changing existing SQLite databases was utterly broken:Ingo Schwarze2013-06-031-2/+4
| | | | | 1) SQL statements were only prepared when creating a new database. 2) We rely heavily on foreign_keys, but never enabled them.
* Starting the preparations to integrate this into OpenBSD.Ingo Schwarze2013-06-031-44/+65
| | | | | | | | | | As variadic macros are not supported on all architectures, replace them by a real function. While here, * choose a more logical order for "dir" and "file" arguments * choose a more logical order when printing; as a bonus, a simple sed 's/:.*//' will get you valid file names * in ofmerge(), skip diagnostic string comparisons when we don't want warnings anyway