CVS log for mandoc/main.c

[BACK] Up to [cvsweb.bsd.lv] / mandoc

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.361 / (download) - annotate - [select for diffs], Thu Apr 14 16:43:43 2022 UTC (2 years, 6 months ago) by schwarze
Branch: MAIN
CVS Tags: HEAD
Changes since 1.360: +8 -2 lines
Diff to previous 1.360 (unified) to selected 1.306 (unified)

support for hunting memory leaks;
designed and written last autumn, polished today

Revision 1.360 / (download) - annotate - [select for diffs], Mon Oct 4 21:29:17 2021 UTC (3 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.359: +13 -15 lines
Diff to previous 1.359 (unified) to selected 1.306 (unified)

Clean up memory handling in spawn_pager(), free(3)ing everything
that is malloc(3)ed.  In addition to being less confusing, the new
code is also shorter by two lines.

Revision 1.359 / (download) - annotate - [select for diffs], Mon Oct 4 20:24:06 2021 UTC (3 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.358: +8 -1 lines
Diff to previous 1.358 (unified) to selected 1.306 (unified)

In man(1) mode, properly clean up the resn[] result array
after processing each name given on the command line.

Failure to do so resulted in a memory leak of about 50 kilobytes
per name given on the command line.  Since man(1) uses a few
Megabytes of memory anyway and people rarely give hundreds of names
on the command line, this leak did not cause practical problems,
but cleaning up properly is better in any case.

Revision 1.358 / (download) - annotate - [select for diffs], Sat Sep 4 22:38:46 2021 UTC (3 years, 2 months ago) by schwarze
Branch: MAIN
CVS Tags: VERSION_1_14_6
Changes since 1.357: +12 -7 lines
Diff to previous 1.357 (unified) to selected 1.306 (unified)

during prioritization for man(1), correctly extract the section name
from the file name extension of gzipped manual page files; bug found
on Alpine Linux by Soeren Tempel <soeren at soeren hyphen tempel dot net>,
who also tested this patch

Revision 1.357 / (download) - annotate - [select for diffs], Sat Sep 4 12:52:57 2021 UTC (3 years, 2 months ago) by schwarze
Branch: MAIN
Changes since 1.356: +66 -22 lines
Diff to previous 1.356 (unified) to selected 1.306 (unified)

In the fallback code to look for manual pages without using mandoc.db(5),
accept files "man<one-digit-section>/<name>.<full-section>"
in addition to the already supported "man<full-section>/name.[01-9]*".
Needed for example on Alpine Linux which puts its Perl manuals
into "man3/<name>.3pm" and the POSIX manuals into "man3/<name>.3p".

While here, allow the glob(3) at the end of fs_lookup() to add multiple
matches to the result set.  This improves man -w output and may also
help some cases of plain man(1), allowing main() to prioritize properly
rather than fs_lookup() picking a random match.

Issue reported and patch tested
by Soeren Tempel <soeren at soeren hyphen tempel dot net>.

Revision 1.356 / (download) - annotate - [select for diffs], Sat Aug 14 13:53:08 2021 UTC (3 years, 2 months ago) by schwarze
Branch: MAIN
Changes since 1.355: +4 -1 lines
Diff to previous 1.355 (unified) to selected 1.306 (unified)

print a BAGARG message if -T markdown is requested on man(7) input;
suggested by Michael Stapelberg at debian dot org

Revision 1.355 / (download) - annotate - [select for diffs], Wed Jun 2 18:28:19 2021 UTC (3 years, 5 months ago) by schwarze
Branch: MAIN
Changes since 1.354: +23 -20 lines
Diff to previous 1.354 (unified) to selected 1.306 (unified)

In -W style mode, check .Xr links along the full manpath because
that is more useful for validating manuals of non-base software.
Nothing changes in -W all mode: by default for -T lint, we still
assume we want to check base system conventions, including usually
not wanting to link to non-base manual pages.

The use case, a partial idea how to handle it, and a preliminary
patch was originally presented by kn@, then refined by me.
Final patch tested and OK'ed by kn@.

Revision 1.354 / (download) - annotate - [select for diffs], Tue Mar 30 17:16:55 2021 UTC (3 years, 7 months ago) by schwarze
Branch: MAIN
Changes since 1.353: +2 -1 lines
Diff to previous 1.353 (unified) to selected 1.306 (unified)

Append .html suffix to temporary files enabling browsers to recognise it.

Occasionally one might read a manual page in a webbrowser, e.g.
"MANPAGER=firefox man -T html jq", however temporary files created for
pagers lack file extensions and most web browsers are unable to detect a
file's content without it.

Special case mandoc(1)'s HTML output format by appending the ".html" suffix
to file names such that browsers will actually render HTML as such instead
of showing it as plain text.

Idea and patch from kn@, with minor help from me.

Revision 1.353 / (download) - annotate - [select for diffs], Fri Aug 7 20:56:55 2020 UTC (4 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.352: +3 -1 lines
Diff to previous 1.352 (unified) to selected 1.306 (unified)

add a forgotten "#if HAVE_PLEDGE";
patch sent in by <alexander dot gromnitsky at gmail dot com>
who found the problem the hard way on Fedora 32

Revision 1.352 / (download) - annotate - [select for diffs], Tue Jul 21 15:10:01 2020 UTC (4 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.351: +27 -11 lines
Diff to previous 1.351 (unified) to selected 1.306 (unified)

undocumented options -O outfilename and -O tagfilename
to support regression testing without a tty;
no user visible change intended

Revision 1.351 / (download) - annotate - [select for diffs], Mon Jul 20 16:57:30 2020 UTC (4 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.350: +2 -2 lines
Diff to previous 1.350 (unified) to selected 1.306 (unified)

Switch the default pager from "more -s" to "less".

POSIX explicitly allows using a different default pager if that is
documented.  Nowadays, the pager provided in most operating systems
is less(1).  Our man(1) implementation uses less(1) features that
traditional more(1) did not provide, in particular tagging.  Besides,
as noted by deraadt@, the user interface of less(1) is slightly
more refined and preferable over the user inferface of more(1).
This switch was originally suggested by Ian Ropers.

In ./configure, test whether less(1) is available.  If not, fall
back to more(1).  In ./configure.local, support overriding the
automatic test by setting BINM_PAGER.

As explained by jmc@ and deraadt@, the -s flag was added a very
long time ago when an antique version of groff(1) had an annoying
bug in terminal output that would randomly display blank lines in
the middle of pages.  Clearly, -s has no longer been needed for
many years, so drop it from the default pager invocation.

OK deraadt@ jmc@ martijn@ job@ on the OpenBSD version of this patch.

Revision 1.350 / (download) - annotate - [select for diffs], Mon Jun 15 17:25:42 2020 UTC (4 years, 4 months ago) by schwarze
Branch: MAIN
Changes since 1.349: +24 -17 lines
Diff to previous 1.349 (unified) to selected 1.306 (unified)

Support -T html -O tag by passing a file:// URI to the pager.
Feature suggested by and implementation based on a patch
from Abel Romero Perez <romeroperezabel at gmail dot com>.

Revision 1.349 / (download) - annotate - [select for diffs], Sun Jun 14 16:24:18 2020 UTC (4 years, 4 months ago) by schwarze
Branch: MAIN
Changes since 1.348: +2 -2 lines
Diff to previous 1.348 (unified) to selected 1.306 (unified)

Fix a regression in rev. 1.319 (2019/03/03):
Pass the right object to html_reset() or it will crash
when rendering more than one manual page to HTML in a row.
Bug reported by Abel Romero Perez <romeroperezabel at gmail dot com>.
Patch from otto@.

Revision 1.348 / (download) - annotate - [select for diffs], Thu Apr 2 22:12:55 2020 UTC (4 years, 7 months ago) by schwarze
Branch: MAIN
Changes since 1.347: +30 -26 lines
Diff to previous 1.347 (unified) to selected 1.306 (unified)

When the last file formatted yielded no tags, the tags file got
deleted before starting the pager, even when earlier input files
had written to it; thanks to weerd@ for reporting that bug.

Since we now generate tags for section headers, we almost always
generate at least some.  Consequently, while fixing the above bug,
simplify the code by never deleting the tags file before the pager
exits, not even in the rare case that the file happens to be empty.
Hence, this patch is -75 +63 LOC even though it fixes two bugs.

While deleting the output files belongs after exit from the pager,
closing them should be done before it is started.  Collect the
related code, which was scattered in various places, to where
it belongs, in a dedicated function in the term_tag.c module.
As a side benefit, never fclose(2) stdout, only dup2(2) to it.

Similarly, when the -O tag argument wasn't found in the last file
formatted, there was a complaint about "no such tag" even when the
argument did occur in earlier files.  Fix that by looking for a
matching tag after every formatted file rather than just once at
the very end.  Given that command line arguments aren't properties
of the file(s) being formatted, that check is a job for the main
program, not for the formatters, so while fixing the check, move
it from term_tag.c to main.c.

Revision 1.347 / (download) - annotate - [select for diffs], Sat Mar 28 16:18:43 2020 UTC (4 years, 7 months ago) by schwarze
Branch: MAIN
Changes since 1.346: +10 -13 lines
Diff to previous 1.346 (unified) to selected 1.306 (unified)

Even though the HTML, man, markdown, PDF, PostScript, and tree formatters
never write a ctags(1) file, using a pager still requires writing the
main output file and passing the file name to the pager.
Recent regression mentioned on IRC and reported by kn@.

Revision 1.346 / (download) - annotate - [select for diffs], Thu Mar 19 12:21:37 2020 UTC (4 years, 7 months ago) by schwarze
Branch: MAIN
Changes since 1.345: +3 -2 lines
Diff to previous 1.345 (unified) to selected 1.306 (unified)

The tag file always needs to be closed before starting the pager,
even when no output formatter was allocated because all pages
shown were preformatted.  Regression in previous reported
by <Andreas dot Kahari at abc dot se> on bugs@.

Revision 1.345 / (download) - annotate - [select for diffs], Fri Mar 13 15:32:28 2020 UTC (4 years, 7 months ago) by schwarze
Branch: MAIN
Changes since 1.344: +19 -18 lines
Diff to previous 1.344 (unified) to selected 1.306 (unified)

Split tagging into a validation part including prioritization
in tag.{h,c} and {mdoc,man}_validate.c
and into a formatting part including command line argument checking
in term_tag.{h,c}, html.c, and {mdoc|man}_{term|html}.c.

Immediate functional benefits include:
* Improved prioritization of automatic tags for .Em and .Sy.
* Avoiding bogus automatic tags when .Em, .Fn, or .Sy are explicitly tagged.
* Explicit tagging of .Er and .Fl now works in HTML output.
* Automatic tagging of .IP and .TP now works in HTML output.
But mainly, this patch provides clean earth to build further improvements on.

Technical changes:
* Main program: Write a tag file for ASCII and UTF-8 output only.
* All formatters: There is no more need to delay writing the tags.
* mdoc(7)+man(7) formatters: No more need for elaborate syntax tree inspection.
* HTML formatter: If available, use the "string" attribute as the tag.
* HTML formatter: New function to write permalinks, to reduce code duplication.

Style cleanup in the vicinity while here:
* mdoc(7) terminal formatter: To set up bold font for children,
defer to termp_bold_pre() rather than calling term_fontpush() manually.
* mdoc(7) terminal formatter: Garbage collect some duplicate functions.
* mdoc(7) HTML formatter: Unify <code> handling, delete redundant functions.
* Where possible, use switch statements rather than if cascades.
* Get rid of some more Yoda notation.

The necessity for such changes was first discussed with kn@, but i didn't
bother him with a request to review the resulting -673/+782 line patch.

Revision 1.344 / (download) - annotate - [select for diffs], Mon Feb 24 21:16:31 2020 UTC (4 years, 8 months ago) by schwarze
Branch: MAIN
Changes since 1.343: +26 -4 lines
Diff to previous 1.343 (unified) to selected 1.306 (unified)

Marc Espie reported that "man p*ipc" displayed the perlipc(1) manual.
The reason was that as a last resort when failing to find a page
name in mandoc.db(5) or at a few well well-defined fully qualified
file names, man(1) uses glob(3) to look for candidate files in
relevant directories, because some operating systems have weird
file name extensions, for example pcap.3pcap and BF_set_key.3ssl
on Linux.  But during that globbing, the metacharacters "*?[" need
to be escaped in the name, section, and path supplied by the user,
or you would get weird false positives and misleading warning
messages and would be unable to use the fallback for path or file
names that actually contain an opening bracket.
Feedback and OK espie@.

Revision 1.343 / (download) - annotate - [select for diffs], Mon Feb 10 13:49:15 2020 UTC (4 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.342: +15 -3 lines
Diff to previous 1.342 (unified) to selected 1.306 (unified)

For compatibility with the man(1) implementations of the man-1.6
and man-db packages, print the manpath if the -w option is given
without a following name argument.

This quirk has been in man-1.6 since at least man-1.5e (1998)
and in man-db since 2012.

Using this feature in portable software is a dubious idea because the
internal organization of manual page directories varies in about a
dozen respects among operating systems, so even if you get the answer,
there is no portable way to use it for looking up anything inside.
However, Matej Cepl <mcepl at suse dot cz> made me aware that some
software, for example the manual viewing functionality in the newest
editors/neovim code, unwisely relies on this feature anyway.

No objections were raised when this patch was shown on tech@.

Revision 1.342 / (download) - annotate - [select for diffs], Thu Feb 6 19:41:40 2020 UTC (4 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.341: +14 -3 lines
Diff to previous 1.341 (unified) to selected 1.306 (unified)

Make sure that -l always causes -w to be ignored, as documented
in the man(1) manual page.  This bugfix is needed to prevent
the command "man -lw" from dereferencing a NULL pointer.

Revision 1.341 / (download) - annotate - [select for diffs], Mon Jan 20 10:37:15 2020 UTC (4 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.340: +2 -1 lines
Diff to previous 1.340 (unified) to selected 1.306 (unified)

Make the code more readable by introducing
symbolic constants for tagging priorities.
This review also made me find a minor bug: do not upgrade
TAG_FALLBACK to TAG_WEAK when there is trailing whitespace.

Revision 1.340 / (download) - annotate - [select for diffs], Sun Jul 28 19:41:21 2019 UTC (5 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.339: +30 -37 lines
Diff to previous 1.339 (unified) to selected 1.306 (unified)

Simplification, no functional change:
Delete the "argc" argument from fs_search() which is now always 1,
and move error reporting to the main() program where it is more
logically placed and easier to see.

Revision 1.339 / (download) - annotate - [select for diffs], Sun Jul 28 18:36:06 2019 UTC (5 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.338: +1 -17 lines
Diff to previous 1.338 (unified) to selected 1.306 (unified)

There is no point in pledge(2)ing literally the same list twice,
so delete the second copy.  No functional change.

Revision 1.338 / (download) - annotate - [select for diffs], Sun Jul 28 18:23:17 2019 UTC (5 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.337: +81 -83 lines
Diff to previous 1.337 (unified) to selected 1.306 (unified)

In man(1) mode, do the search for each name independently, and
show the results in the order of the command line arguments.
Implemented by separating the code for man(1) and apropos(1)
in the main() program.
Surprisingly, the number of lines of code remains unchanged.
Issue reported by deraadt@, additional input from millert@.

Revision 1.337 / (download) - annotate - [select for diffs], Sun Jul 28 13:13:03 2019 UTC (5 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.336: +91 -81 lines
Diff to previous 1.336 (unified) to selected 1.306 (unified)

Improve structure, no functional change:
Unify code to process one single input file
and move it into a dedicated new function.

Revision 1.336 / (download) - annotate - [select for diffs], Sat Jul 27 13:40:57 2019 UTC (5 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.335: +22 -27 lines
Diff to previous 1.335 (unified) to selected 1.306 (unified)

Move two more output state variables into the new struct outstate.
Also, move setting of tag_files.tagname into tag_init().
No functional change.

Revision 1.335 / (download) - annotate - [select for diffs], Fri Jul 26 23:12:15 2019 UTC (5 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.334: +62 -60 lines
Diff to previous 1.334 (unified) to selected 1.306 (unified)

Cleanup, no functional change:
For clarity, stop storing the same information (in this case, -O
settings) in two structs.  Give the local struct in main.c a more
descriptive name (output state).

Revision 1.334 / (download) - annotate - [select for diffs], Fri Jul 26 21:03:19 2019 UTC (5 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.333: +44 -38 lines
Diff to previous 1.333 (unified) to selected 1.306 (unified)

Structural cleanup, no functional change:
Mixing parser and formatter state in the same struct was a bad idea,
so pull the parser state and configuration out of it.
This makes sure output options are not passed into parser functions
and parser options are not passed into output functions.
While here, add comments to the important local variables in main().

Revision 1.333 / (download) - annotate - [select for diffs], Fri Jul 26 18:01:43 2019 UTC (5 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.332: +61 -55 lines
Diff to previous 1.332 (unified) to selected 1.306 (unified)

Structural cleanup, no functional change:
Move process group management out of main() into its own function
because it has its own, self-contained logic and its own local variables.

Revision 1.332 / (download) - annotate - [select for diffs], Fri Jul 19 20:27:25 2019 UTC (5 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.331: +2 -2 lines
Diff to previous 1.331 (unified) to selected 1.306 (unified)

If no tags were generated at all, unlink(2) the empty tags file as
soon as the condition can be detected and do not pass it to less(1).
This may happen for man(7) pages, for preformatted pages, and for
very simple pages like true(1).  The main benefit is that :t inside
less(1) yields the clearer diagnostic message "No tags file" rather
than the mildly confusing "No such tag in tags file": the latter
might encourage further, futile attempts to jump to other tags.

Improvement suggested by Leah Neukirchen <leah at vuxu dot org>
from The Void.

Revision 1.331 / (download) - annotate - [select for diffs], Mon Jul 15 21:41:08 2019 UTC (5 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.330: +3 -2 lines
Diff to previous 1.330 (unified) to selected 1.306 (unified)

don't print the final heads-up about messages
when a search did not yield any manual pages to display;
issue found with regress/usr.bin/mandoc/db/

Revision 1.330 / (download) - annotate - [select for diffs], Sun Jul 14 18:16:13 2019 UTC (5 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.329: +4 -2 lines
Diff to previous 1.329 (unified) to selected 1.306 (unified)

If messages are shown and output is printed without a pager, display
a heads-up on stderr at the end because otherwise, users may easily
miss the messages: because messages typically occur while parsing,
they typically preceed the output.  This is most useful with flag
combinations like "-c -W all" but may also help in some unusual
error scenarios.
Inconvenient ordering of output originally pointed out by espie@
for the example situation that /tmp/ is not writeable.

Revision 1.329 / (download) - annotate - [select for diffs], Wed Jul 10 19:39:01 2019 UTC (5 years, 4 months ago) by schwarze
Branch: MAIN
Changes since 1.328: +142 -157 lines
Diff to previous 1.328 (unified) to selected 1.306 (unified)

Some time ago, i simplified mandoc_msg() such that it can be used
everywhere and not only in the parsers.
For more uniform messages, use it at more places instead of err(3),
in particular in the main program.
While here, integrate a few trivial functions called at exactly one
place into the main option parser, and let a few more functions use
the normal convention of returning 0 for success and -1 for error.

Revision 1.328 / (download) - annotate - [select for diffs], Sat Jul 6 20:05:27 2019 UTC (5 years, 4 months ago) by schwarze
Branch: MAIN
Changes since 1.327: +5 -3 lines
Diff to previous 1.327 (unified) to selected 1.306 (unified)

prevent mandoc from segfaulting if /tmp is not writable;
patch from espie@

Revision 1.327 / (download) - annotate - [select for diffs], Fri May 3 18:39:34 2019 UTC (5 years, 6 months ago) by schwarze
Branch: MAIN
Changes since 1.326: +3 -6 lines
Diff to previous 1.326 (unified) to selected 1.306 (unified)

avoid duplicate "bad argument" error message, also shortening the code

Revision 1.326 / (download) - annotate - [select for diffs], Fri May 3 17:31:15 2019 UTC (5 years, 6 months ago) by schwarze
Branch: MAIN
Changes since 1.325: +12 -7 lines
Diff to previous 1.325 (unified) to selected 1.306 (unified)

In fs_lookup(), use stat(2) rather than access(2) to check file existence.
Some mildly broken real-world packages on some operating systems
contain dangling symlinks in manual page directories: pestering the
user to run makewhatis(8) makes no sense because that won't help.
On the other hand, missing read permissions deserve ugly error messages
and are unlikely to occur in practice anyway.

Fixing an issue reported by Lorenzo Beretta <loreb at github>
as part of https://github.com/void-linux/void-packages/issues/9868 .

Revision 1.325 / (download) - annotate - [select for diffs], Fri May 3 16:14:42 2019 UTC (5 years, 6 months ago) by schwarze
Branch: MAIN
Changes since 1.324: +17 -6 lines
Diff to previous 1.324 (unified) to selected 1.306 (unified)

In man(1) mode with a specific section requested,
try harder to find the best match.

Use this order of preference:
1. The section in both the directory name and the file name matches exactly.
2. The section in the file name matches exactly.
3. The section in the directory name matches exactly.
4. Neither of them matches exactly.
The latter can happen when mansearch() finds substring matches
or when the second .Dt argument mismatches the dir and file names.

Lorenzo Beretta <loreb at github> reported that this caused real
problems on Void Linux, like "man 3 readline" showing readline(3m).
See https://github.com/void-linux/void-packages/issues/9868 for details.

Revision 1.324 / (download) - annotate - [select for diffs], Fri May 3 09:39:25 2019 UTC (5 years, 6 months ago) by schwarze
Branch: MAIN
Changes since 1.323: +2 -2 lines
Diff to previous 1.323 (unified) to selected 1.306 (unified)

In man(1) mode, when the first argument starts with a digit,
optionally followed by a letter, and at least one more argument
follows, interpret the first argument as a section name even when
additional characters follow after the digit and letter.

This is needed because many operating systems have section names
consisting of a digit followed by more than one letter - for example
Illumos, Solaris, Linux, even NetBSD.

There is very little risk of regressions: in the whole corpus of
manual pages on man.openbsd.org, there isn't a single manual page
name starting with a digit.  And even if programs like "0ad" or
"4channels" had manual pages, "man 0ad" and "man -a cat 0ad" would
still work, only "man -a 0ad cat" will fail with "man: No entry for
cat in section 0ad of the manual."

Fixing one of the issues reported by Lorenzo Beretta <loreb at github>
as part of https://github.com/void-linux/void-packages/issues/9868 .

Revision 1.323 / (download) - annotate - [select for diffs], Tue Apr 30 18:51:57 2019 UTC (5 years, 6 months ago) by schwarze
Branch: MAIN
Changes since 1.322: +3 -1 lines
Diff to previous 1.322 (unified) to selected 1.306 (unified)

In man(1) mode, i.e. when asking for a single manual page by name,
prefer file name matches over .Dt/.TH matches over first NAME matches
over later NAME matches, but do not change the ordering for apropos(1)
nor for man -a.

This reverts main.c rev. 1.310 and mansearch.h rev. 1.29
and includes a partial revert of mansearch.c rev. 1.79.

Regression reported by Lorenzo Beretta <loreb at github>
as part of https://github.com/void-linux/void-packages/issues/9868 .

Revision 1.322 / (download) - annotate - [select for diffs], Wed Mar 6 10:18:58 2019 UTC (5 years, 8 months ago) by schwarze
Branch: MAIN
CVS Tags: VERSION_1_14_5
Changes since 1.321: +5 -1 lines
Diff to previous 1.321 (unified) to selected 1.306 (unified)

autoconfiguration test whether less(1) supports the -T option;
needed for Alpine Linux because it uses busybox less(1) by default;
based on a patch from Daniel Sabogal explained to me by Natanael Copa

Revision 1.321 / (download) - annotate - [select for diffs], Mon Mar 4 18:15:06 2019 UTC (5 years, 8 months ago) by schwarze
Branch: MAIN
Changes since 1.320: +2 -2 lines
Diff to previous 1.320 (unified) to selected 1.306 (unified)

For TIOCGWINSZ, #include <termios.h> rather than <sys/termios.h>
like almost all other userland programs.  This also improves
portability: for example, it looks like <sys/termios.h> does not
work on FreeBSD, or at least bapt@ did the same change over there.

Revision 1.320 / (download) - annotate - [select for diffs], Mon Mar 4 13:01:57 2019 UTC (5 years, 8 months ago) by schwarze
Branch: MAIN
Changes since 1.319: +6 -2 lines
Diff to previous 1.319 (unified) to selected 1.306 (unified)

When the -S option is given to man(1) and the requested manual page
name is not found and the requested architecture is unknown, complain
about the architecture rather than about the manual page name:

$ man -S vax cpu
man: Unknown architecture "vax".
$ man -S sparc64 foobar
man: No entry for foobar in the manual.

Friendlier error message suggested by jmc@, who also OK'ed the patch.

Revision 1.319 / (download) - annotate - [select for diffs], Sun Mar 3 13:02:11 2019 UTC (5 years, 8 months ago) by schwarze
Branch: MAIN
Changes since 1.318: +3 -1 lines
Diff to previous 1.318 (unified) to selected 1.306 (unified)

Reset HTML formatter state, in particular the id_unique hash,
after processing each manual page, such that the next page
starts from a clean state and doesn't continue suffix numbering.

Issue found while looking at https://github.com/Debian/debiman/issues/48
which was brought up by Orestis Ioannou <oorestisime at github>.

Revision 1.318 / (download) - annotate - [select for diffs], Fri Jan 11 17:04:44 2019 UTC (5 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.317: +2 -2 lines
Diff to previous 1.317 (unified) to selected 1.306 (unified)

Improve error reporting when a file given on the command line
cannot be opened:
* Mention the filename.
* Report the errno for the file itself, not the one with .gz appended.

Revision 1.317 / (download) - annotate - [select for diffs], Thu Jan 10 06:29:00 2019 UTC (5 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.316: +3 -2 lines
Diff to previous 1.316 (unified) to selected 1.306 (unified)

Initializers for file-scope static variables should be compile-time
constants, and while stderr is a compile-time constant in OpenBSD,
Kelvin Sherlock <ksherlock at gmail dot com> reports that it isn't
on some other systems, for example on FreeBSD or Linux.
So do the initialization by calling mandoc_msg_setoutfile()
from main() instead.

Revision 1.316 / (download) - annotate - [select for diffs], Tue Jan 1 08:18:11 2019 UTC (5 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.315: +17 -8 lines
Diff to previous 1.315 (unified) to selected 1.306 (unified)

Support taking the -O tag value from apropos(1) key=value search terms;
feature improvement suggested by kn@.
While here, also make "-O value" work from standard input.
OK kn@

Revision 1.315 / (download) - annotate - [select for diffs], Sun Dec 30 00:49:55 2018 UTC (5 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.314: +17 -20 lines
Diff to previous 1.314 (unified) to selected 1.306 (unified)

Cleanup, no functional change:

The struct roff_man used to be a bad mixture of internal parser
state and public parsing results.  Move the public results to the
parsing result struct roff_meta, which is already public.  Move the
rest of struct roff_man to the parser-internal header roff_int.h.

Since the validators need access to the parser state, call them
from the top level parser during mparse_result() rather than from
the main programs, also reducing code duplication.

This keeps parser internal state out of thee main programs (five
in mandoc portable) and out of eight formatters.

Revision 1.314 / (download) - annotate - [select for diffs], Thu Dec 20 21:30:32 2018 UTC (5 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.313: +6 -4 lines
Diff to previous 1.313 (unified) to selected 1.306 (unified)

Move the full responsibility for reporting open(2) errors from
mparse_open() to the caller.  That is better because only the caller
knows its preferred reporting method and format and only the caller
has access to all the data that should be included - like the column
number in .so processing or the current manpath in makewhatis(8).
Moving the mandoc_msg() call out is possible because the caller can
call strerror(3) just as easily as mparse_open() can.

Move mandoc_msg_setinfilename() closer to the parsing of the file
contents, to avoid problems *with* the file (like non-existence,
lack of permissions, etc.) getting misreported as problems *in*
the file.

Fix the column number reported for .so failure:
let it point to the beginning of the filename.

Taken together, this prevents makewhatis(8) from spewing confusing
messages about .so failures to stderr, a bug reported by
Raf Czlonka <rczlonka at gmail dot com> on ports@.

It also prevents mandoc(1) from issuing *two* messages for every
single .so failure.

Revision 1.313 / (download) - annotate - [select for diffs], Fri Dec 14 05:18:02 2018 UTC (5 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.312: +5 -6 lines
Diff to previous 1.312 (unified) to selected 1.306 (unified)

Almost mechanical diff to remove the "struct mparse *" argument
from mandoc_msg(), where it is no longer used.
While here, rename mandoc_vmsg() to mandoc_msg() and retire the
old version:  There is really no point in having another function
merely to save "%s" in a few places.
Minus 140 lines of code.

Revision 1.312 / (download) - annotate - [select for diffs], Fri Dec 14 01:18:25 2018 UTC (5 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.311: +38 -74 lines
Diff to previous 1.311 (unified) to selected 1.306 (unified)

Major cleanup; may imply minor changes in edge cases of error reporting.

Finally, drop support for the run-time configurable mandocmsg()
callback.  It was over-engineered from the start, never used for
anything in a decade, and repeatedly caused maintenance headaches.

Consolidate reporting infrastructure into two files, mandoc.h and
mandoc_msg.c, mopping up the bits and pieces that were scattered
around main.c, read.c, mandoc_parse.h, libmandoc.h, the prototypes
of four parsing-related functions, and both parser structs.

Revision 1.311 / (download) - annotate - [select for diffs], Thu Dec 13 11:55:46 2018 UTC (5 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.310: +2 -1 lines
Diff to previous 1.310 (unified) to selected 1.306 (unified)

Cleanup, no functional change:
Split the top level parser interface out of the utility header
mandoc.h, into a new header mandoc_parse.h, for use in the main
program and in the main parser only.
Move enum mandoc_os into roff.h because struct roff_man is the
place where it is stored.
This allows removal of mandoc.h from seven files in low-level
parsers and in formatters.

Revision 1.310 / (download) - annotate - [select for diffs], Thu Nov 22 12:01:46 2018 UTC (5 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.309: +1 -3 lines
Diff to previous 1.309 (unified) to selected 1.306 (unified)

In apropos(1) output, stop sorting .Nm search results by name
priorities (bits).  The obscure feature wasn't documented and merely
confused people - for example Edward Tomasz Napierala <trasz at
FreeBSD>, see https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=227408.

Smaller patch provided by Yuri Pankov <yuripv at FreeBSD>, but i'm
also retiring the now unused "bits" member from struct manpage.
Simplification is good.

Revision 1.309 / (download) - annotate - [select for diffs], Thu Nov 22 11:30:23 2018 UTC (5 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.308: +17 -5 lines
Diff to previous 1.308 (unified) to selected 1.306 (unified)

In -T locale (the default), -T ascii, and -T utf8 mode, provide a new
output option -O tag[=term] to move right to the definition of "term" when
opening the manual page in a pager, effectively porting the -T html
fragment name feature - https://man.openbsd.org/ksh#ulimit - to the
terminal.  Try:

$ man -O tag uvm_sysctl
$ man -O tag=ulimit ksh
$ man -O tag 3 compress

Feature development triggered by a question from kn@.  Klemens also
tested, provided feedback that resulted in improvements, and provided
an OK.

Revision 1.308 / (download) - annotate - [select for diffs], Thu Aug 23 19:33:27 2018 UTC (6 years, 2 months ago) by schwarze
Branch: MAIN
Changes since 1.307: +2 -8 lines
Diff to previous 1.307 (unified) to selected 1.306 (unified)

The upcoming .while request will have to re-execute roff(7) lines
parsed earlier, so they will have to be saved for reuse - but the
read.c preparser does not know yet whether a line contains a .while
request before passing it to the roff parser.  To cope with that,
save all parsed lines for now.  Even shortens the code by 20 lines.

Revision 1.307 / (download) - annotate - [select for diffs], Thu Aug 9 17:30:36 2018 UTC (6 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.306: +9 -3 lines
Diff to previous 1.306 (unified)

If somebody asks "man 3 chmod",
don't respond with the lie: "No entry for chmod in the manual."
Instead, say "No entry for chmod in section 3 of the manual."
Came up after a question from kn@; OK kn@.

Revision 1.306 / (download) - annotate - [selected], Mon May 14 14:10:23 2018 UTC (6 years, 5 months ago) by schwarze
Branch: MAIN
CVS Tags: VERSION_1_14_4
Changes since 1.305: +3 -2 lines
Diff to previous 1.305 (unified)

Some broken terminal emulators (e.g. sakura) do the equivalent
of "stty cols 0".  Ignore that insanity rather than setting
conf.output.width to an invalid value and embarking on infinite loops.
Issue reported by Jesper Wallin <jesper at ifconfig dot se>, thanks!

Revision 1.305 / (download) - annotate - [select for diffs], Thu Apr 19 16:25:24 2018 UTC (6 years, 6 months ago) by schwarze
Branch: MAIN
Changes since 1.304: +57 -13 lines
Diff to previous 1.304 (unified) to selected 1.306 (unified)

Compatibility with man-db:
In page name mode (= man(1) default mode), also try to interpret
names containing slashes as absolute or relative file names.

Missing feature reported by Nate Bargmann on <groff at gnu dot org>,
and the man-db maintainer Colin Watson <cjwatson at debian dot org>
kindly explained to me how this is supposed to work.

Revision 1.304 / (download) - annotate - [select for diffs], Fri Apr 13 19:55:30 2018 UTC (6 years, 7 months ago) by schwarze
Branch: MAIN
Changes since 1.303: +14 -2 lines
Diff to previous 1.303 (unified) to selected 1.306 (unified)

Use TIOCGWINSZ to reduce the default -Owidth during interactive use
on terminals narrower than 79 columns and the default -Oindent on
terminals narrower than 66 columns.
Requested by and feedback from pirofti@;
mpi@ and juanfra@ also like the general direction.

Revision 1.303 / (download) - annotate - [select for diffs], Fri Feb 23 16:47:10 2018 UTC (6 years, 8 months ago) by schwarze
Branch: MAIN
Changes since 1.302: +2 -2 lines
Diff to previous 1.302 (unified) to selected 1.306 (unified)

Invalidate the tag_files.tfd after fclose(3)ing the stram associated
with it.  In main() assert that the tfd was actually invalidated.
This avoids closing an invalid fd.
From tb@; OK deraadt@ on an earlier version.

Revision 1.302 / (download) - annotate - [select for diffs], Mon Aug 21 15:42:58 2017 UTC (7 years, 2 months ago) by schwarze
Branch: MAIN
Changes since 1.301: +12 -1 lines
Diff to previous 1.301 (unified) to selected 1.306 (unified)

When the stdout stream gets broken, there is no point in reading
any more input files, and it would be misleading to start a parser,
because that would show randomly truncated text.
Instead, print an error message and exit the program.

Issue found by Leah Neukirchen <leah at vuxu dot org>, who was
surprised to see half a manpage when her /tmp/ overflew.

Revision 1.301 / (download) - annotate - [select for diffs], Wed Jul 26 10:21:55 2017 UTC (7 years, 3 months ago) by schwarze
Branch: MAIN
CVS Tags: VERSION_1_14_3, VERSION_1_14_2
Changes since 1.300: +2 -2 lines
Diff to previous 1.300 (unified) to selected 1.306 (unified)

Cast the return value of chdir(2) to void.  We already have a comment
above explaining to human auditors why no error checking is needed
here, so it's only fair to tell the compiler, too.
Worried compiler reported by Michael <Stapelberg at debian>.

Revision 1.300 / (download) - annotate - [select for diffs], Thu Jul 20 15:26:41 2017 UTC (7 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.299: +10 -7 lines
Diff to previous 1.299 (unified) to selected 1.306 (unified)

For -Tlint, put parser messages on stdout instead of stderr.

Originally, naddy@ requested this in 2011 (or maybe even earlier).
It was discussed with joerg@, kristaps@, naddy@, and espie@ in 2011,
and everybody agreed in principle, but it was postponed because
kristaps@ wanted to do some cleanup of the message system first.
Meanwhile, message infrastructure was improved about a dozen times...

This makes long, tedious commands like "mandoc -Tlint *.1 2>&1 | less"
unnecessary and allows simple ones like "man -l -Tlint *.1".

Revision 1.299 / (download) - annotate - [select for diffs], Tue Jul 4 14:40:38 2017 UTC (7 years, 4 months ago) by schwarze
Branch: MAIN
Changes since 1.298: +2 -3 lines
Diff to previous 1.298 (unified) to selected 1.306 (unified)

Printing "BASE:" in messages about violations of base system conventions
is confusing, simply print "STYLE:", which is intuitive and does not
sound excessively alarming; suggested by jmc@, OK tedu@ jmc@.

Revision 1.298 / (download) - annotate - [select for diffs], Sun Jul 2 21:18:29 2017 UTC (7 years, 4 months ago) by schwarze
Branch: MAIN
Changes since 1.297: +6 -2 lines
Diff to previous 1.297 (unified) to selected 1.306 (unified)

If a single page references the same non-existent manual more than
once, print "(N times)" after the message "referenced manual not
found", to lessen the risk that people fix the first instance and
miss the others; jmc@ confirmed that this is useful.

Revision 1.297 / (download) - annotate - [select for diffs], Sun Jul 2 15:31:59 2017 UTC (7 years, 4 months ago) by schwarze
Branch: MAIN
Changes since 1.296: +6 -4 lines
Diff to previous 1.296 (unified) to selected 1.306 (unified)

add warning "cross reference to self"; inspired by mdoclint

Revision 1.296 / (download) - annotate - [select for diffs], Sat Jul 1 12:54:07 2017 UTC (7 years, 4 months ago) by schwarze
Branch: MAIN
Changes since 1.295: +12 -3 lines
Diff to previous 1.295 (unified) to selected 1.306 (unified)

When checking cross references with -Tlint, ultimately fall back to
looking in the current working directory.  Not a security issue
because the files are never open(2)ed, only access(2)ed.
Requested by jmc@ and inspired by mdoclint(1).

This cannot be perfect because it only works for files having the
exact filename ./pagename.sec - mandoc has no way to figure out
which files might contain a manual for multiple names, or that files
in autohell might be called ./pagename.man.in instead, or which
subdirectories might contain additional source files.  Also, it may
hide messages if you have bogus stuff lying around in the directory
where you run mandoc -Tlint.  But jmc@ considers it important, and
good enough for everyday use.

Also avoid leaking the memory for the file name while here.

Revision 1.295 / (download) - annotate - [select for diffs], Sat Jul 1 12:02:31 2017 UTC (7 years, 4 months ago) by schwarze
Branch: MAIN
Changes since 1.294: +13 -7 lines
Diff to previous 1.294 (unified) to selected 1.306 (unified)

When checking the validity of cross references with -Tlint,
fall back from database search to file system search
just like man(1) does when looking up manuals.

This is not too expensive because on a system having up-to-date
mandoc.db(5) files, it only prolongs the time needed to check
*invalid* references - and you are not supposed to have many of
those, right?  And on a system with missing or invalid mandoc.db(5)
files, spending a bit of time and warning loudly about the real
problem is also better than quickly issuing bogus warnings about
cross references that are actually valid.

Revision 1.294 / (download) - annotate - [select for diffs], Sat Jul 1 09:47:30 2017 UTC (7 years, 4 months ago) by schwarze
Branch: MAIN
Changes since 1.293: +34 -1 lines
Diff to previous 1.293 (unified) to selected 1.306 (unified)

Basic reporting of .Xrs to manual pages that don't exist
in the base system, inspired by mdoclint(1).

We are able to do this because (1) the -mdoc parser, the -Tlint validator,
and the man(1) manual page lookup code are all in the same program
and (2) the mandoc.db(5) database format allows fast lookup.

Feedback from, previous versions tested by, and OK jmc@.

A few features will be added to this in the tree, step by step.

Revision 1.293 / (download) - annotate - [select for diffs], Sat Jun 24 14:38:32 2017 UTC (7 years, 4 months ago) by schwarze
Branch: MAIN
Changes since 1.292: +43 -26 lines
Diff to previous 1.292 (unified) to selected 1.306 (unified)

Split -Wstyle into -Wstyle and the even lower -Wbase, and add
-Wopenbsd and -Wnetbsd to check conventions for the base system of
a specific operating system.  Mark operating system specific messages
with "(OpenBSD)" at the end.

Please use just "-Tlint" to check base system manuals (defaulting
to -Wall, which is now -Wbase), but prefer "-Tlint -Wstyle" for the
manuals of portable software projects you maintain that are not
part of OpenBSD base, to avoid bogus recommendations about base
system conventions that do not apply.

Issue originally reported by semarie@, solution using
an idea from tedu@, discussed with jmc@ and jca@.

Revision 1.292 / (download) - annotate - [select for diffs], Sat Jun 3 12:17:25 2017 UTC (7 years, 5 months ago) by schwarze
Branch: MAIN
Changes since 1.291: +2 -2 lines
Diff to previous 1.291 (unified) to selected 1.306 (unified)

enable -Wstyle by default in -Tlint; OK jmc@

Revision 1.291 / (download) - annotate - [select for diffs], Wed May 17 23:39:31 2017 UTC (7 years, 5 months ago) by schwarze
Branch: MAIN
Changes since 1.290: +1 -3 lines
Diff to previous 1.290 (unified) to selected 1.306 (unified)

Delete the -T xhtml command line option.
It has been obsolete for more than two years.
Use -T html.

Revision 1.290 / (download) - annotate - [select for diffs], Tue May 16 19:06:30 2017 UTC (7 years, 5 months ago) by schwarze
Branch: MAIN
Changes since 1.289: +14 -11 lines
Diff to previous 1.289 (unified) to selected 1.306 (unified)

Introduce a new mandoc(1) message level, -W style, below -W warning.
Switch -W all from meaning -W warning to meaning -W style.
The meaning of -T lint does *not* change, it still implies -W warning.
No messages on the new level yet, but they will come.

Usually, i do not lightly make the user interface larger.
But this has been planned for years, and EXIT STATUS 1
was reserved for it all the time.  The message system
is now stable enough to finally implement it.

jmc@ regarding the concept: "really good idea"

Revision 1.289 / (download) - annotate - [select for diffs], Tue Apr 18 16:01:20 2017 UTC (7 years, 6 months ago) by schwarze
Branch: MAIN
Changes since 1.288: +7 -3 lines
Diff to previous 1.288 (unified) to selected 1.306 (unified)

Now that global -i is gone, pass -i through to the apropos(1)
expression parser, such that "apropos -i 'Nm~dump\>'"
finds kdump(1) and WCOREDUMP(2) and you don't need
to type the counter-intuitive "apropos -- -i 'Nm~dump\>'".

Revision 1.288 / (download) - annotate - [select for diffs], Tue Apr 18 15:27:09 2017 UTC (7 years, 6 months ago) by schwarze
Branch: MAIN
Changes since 1.287: +1 -5 lines
Diff to previous 1.287 (unified) to selected 1.306 (unified)

Delete the undocumented and unimplemented man(1) -i (interactive
apropos) option.  It will not be implemented.  Featurism isn't the
plan for the future; simplicity is.

Revision 1.287 / (download) - annotate - [select for diffs], Mon Mar 27 18:51:36 2017 UTC (7 years, 7 months ago) by schwarze
Branch: MAIN
Changes since 1.286: +8 -10 lines
Diff to previous 1.286 (unified) to selected 1.306 (unified)

simplify the SYNOPSIS as well, just like the option lists;
suggested by and OK jmc@

Revision 1.286 / (download) - annotate - [select for diffs], Mon Mar 20 14:32:24 2017 UTC (7 years, 7 months ago) by schwarze
Branch: MAIN
Changes since 1.285: +8 -16 lines
Diff to previous 1.285 (unified) to selected 1.306 (unified)

Silently ignore invalid -m input formats rather than erroring out.
As observed by Jan Stary <hans at stare dot cz>, this is useful such
that after 'alias man="man -m $HOME/man"', 'man -l foo.1' still works.
Simplify and shorten the description of -m, and use .Ic for macros.

Revision 1.285 / (download) - annotate - [select for diffs], Fri Mar 3 14:23:23 2017 UTC (7 years, 8 months ago) by schwarze
Branch: MAIN
Changes since 1.284: +7 -1 lines
Diff to previous 1.284 (unified) to selected 1.306 (unified)

new -mdoc -Tmarkdown output mode; OK millert@ reyk@ tb@;
thanks to reyk@ and to Vsevolod at FreeBSD for suggesting it

Revision 1.284 / (download) - annotate - [select for diffs], Wed Feb 22 14:58:48 2017 UTC (7 years, 8 months ago) by schwarze
Branch: MAIN
Changes since 1.283: +3 -3 lines
Diff to previous 1.283 (unified) to selected 1.306 (unified)

Since SQLite is gone, we no longer need the "flock" pledge.
Patch from semarie@, OK tb@.

Revision 1.273.2.9 / (download) - annotate - [select for diffs], Tue Feb 21 17:04:04 2017 UTC (7 years, 8 months ago) by schwarze
Branch: VERSION_1_13
Changes since 1.273.2.8: +1 -21 lines
Diff to previous 1.273.2.8 (unified) next main 1.274 (unified) to selected 1.306 (unified)

Drop support for building without SQLite.
There whole point of the 1.13 branch is SQLite support after all.

Revision 1.273.2.8 / (download) - annotate - [select for diffs], Fri Feb 17 14:50:13 2017 UTC (7 years, 8 months ago) by schwarze
Branch: VERSION_1_13
Changes since 1.273.2.7: +2 -2 lines
Diff to previous 1.273.2.7 (unified) to selected 1.306 (unified)

merge small style improvements from christos@ to the 1.13 branch

Revision 1.283 / (download) - annotate - [select for diffs], Fri Feb 17 14:31:52 2017 UTC (7 years, 8 months ago) by schwarze
Branch: MAIN
CVS Tags: VERSION_1_14_1
Changes since 1.282: +2 -2 lines
Diff to previous 1.282 (unified) to selected 1.306 (unified)

Be consistent in protecting __attribute__ attributes with __;
from Christos Zoulas <christos @ NetBSD>.

Revision 1.273.2.7 / (download) - annotate - [select for diffs], Thu Feb 16 16:19:16 2017 UTC (7 years, 8 months ago) by schwarze
Branch: VERSION_1_13
Changes since 1.273.2.6: +23 -18 lines
Diff to previous 1.273.2.6 (unified) to selected 1.306 (unified)

merge revision 1.282: fix apropos -O

Revision 1.282 / (download) - annotate - [select for diffs], Thu Feb 16 10:56:07 2017 UTC (7 years, 8 months ago) by schwarze
Branch: MAIN
Changes since 1.281: +23 -18 lines
Diff to previous 1.281 (unified) to selected 1.306 (unified)

Fix rev. 1.280: -O syntax is different in default apropos(1) output
mode and in other output modes, so do not error out prematurely.
Also sort local variables in main() while here.

Revision 1.273.2.6 / (download) - annotate - [select for diffs], Fri Feb 10 15:57:47 2017 UTC (7 years, 9 months ago) by schwarze
Branch: VERSION_1_13
Changes since 1.273.2.5: +5 -3 lines
Diff to previous 1.273.2.5 (unified) to selected 1.306 (unified)

merge main.c 1.281, manpath.c 1.33: -Ttree -Onoval

Revision 1.281 / (download) - annotate - [select for diffs], Fri Feb 10 15:45:28 2017 UTC (7 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.280: +5 -3 lines
Diff to previous 1.280 (unified) to selected 1.306 (unified)

In -Ttree output mode, show the BROKEN node flag and
provide a -Onoval output option to show the unvalidated tree.

Revision 1.273.2.5 / (download) - annotate - [select for diffs], Fri Jan 27 14:41:40 2017 UTC (7 years, 9 months ago) by schwarze
Branch: VERSION_1_13
Changes since 1.273.2.4: +10 -4 lines
Diff to previous 1.273.2.4 (unified) to selected 1.306 (unified)

merge manpath.c 1.32, main.c 1.280: warn about invalid output options

Revision 1.280 / (download) - annotate - [select for diffs], Fri Jan 27 13:47:10 2017 UTC (7 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.279: +10 -4 lines
Diff to previous 1.279 (unified) to selected 1.306 (unified)

warn about invalid output options
and error out if they occur on the command line;
missing feature found in the TODO file

Revision 1.273.2.4 / (download) - annotate - [select for diffs], Mon Jan 9 17:57:15 2017 UTC (7 years, 10 months ago) by schwarze
Branch: VERSION_1_13
Changes since 1.273.2.3: +6 -6 lines
Diff to previous 1.273.2.3 (unified) to selected 1.306 (unified)

merge rev. 1.279: make "cat foo.mdoc | man -l" work

Revision 1.279 / (download) - annotate - [select for diffs], Mon Jan 9 17:49:57 2017 UTC (7 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.278: +6 -6 lines
Diff to previous 1.278 (unified) to selected 1.306 (unified)

Use stdout rather than stdin for controlling the terminal
such that "cat foo.mdoc | man -l" works.
Issue reported by Christian Neukirchen <chneukirchen at gmail dot com>
and also tested by him on Void Linux with both glibc and musl.
The patch makes sense to millert@.

Revision 1.273.2.3 / (download) - annotate - [select for diffs], Mon Jan 9 02:27:58 2017 UTC (7 years, 10 months ago) by schwarze
Branch: VERSION_1_13
Changes since 1.273.2.2: +3 -2 lines
Diff to previous 1.273.2.2 (unified) to selected 1.306 (unified)

merge rev. 1.278: call new function mparse_updaterc()

Revision 1.278 / (download) - annotate - [select for diffs], Mon Jan 9 01:37:03 2017 UTC (7 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.277: +3 -2 lines
Diff to previous 1.277 (unified) to selected 1.306 (unified)

Warnings and errors that occur during mdoc_validate()
or during man_validate() have to affect the mandoc(1) EXIT STATUS.
Many thanks to <Yuri dot Pankov at gmail dot com> (illumos developer)
for reporting this regression.

Revision 1.273.2.2 / (download) - annotate - [select for diffs], Sun Sep 18 16:13:02 2016 UTC (8 years, 1 month ago) by schwarze
Branch: VERSION_1_13
Changes since 1.273.2.1: +49 -32 lines
Diff to previous 1.273.2.1 (unified) to selected 1.306 (unified)

merge wide stream fixes from HEAD to 1.13, rev. 1.276 and 1.277

Revision 1.277 / (download) - annotate - [select for diffs], Sun Sep 18 15:47:45 2016 UTC (8 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.276: +15 -5 lines
Diff to previous 1.276 (unified) to selected 1.306 (unified)

We cannot use fputs(3) in passthrough() because the stdout stream
might be in stdio wide orientation due to prior formatting of an
unformatted manual in man -aTutf8 mode.  So for now, use fflush(3)
followed by unbuffered write(2) instead.  Fixes output corruption
on glibc discovered on Linux while testing a diff to fix a loosely
related bug reported by <jmates at ee dot washington dot edu>.

I detest the concept of stdio stream orientation.  One day, i will
rewrite term_ascii.c to always use narrow streams, even in UTF-8
output mode.  But that's too much work for today.

Revision 1.276 / (download) - annotate - [select for diffs], Sun Sep 18 15:22:08 2016 UTC (8 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.275: +35 -28 lines
Diff to previous 1.275 (unified) to selected 1.306 (unified)

Make sure an output device is allocated before calling terminal_sepline(),
fixing a NULL pointer access that happened when the first of multiple pages
shown was preformatted, as in "man -a groff troff".
Crash reported by <jmates at ee dot washington dot edu> on bugs@, thanks!

Revision 1.273.2.1 / (download) - annotate - [select for diffs], Tue Aug 9 15:15:34 2016 UTC (8 years, 3 months ago) by schwarze
Branch: VERSION_1_13
Changes since 1.273: +3 -2 lines
Diff to previous 1.273 (unified) to selected 1.306 (unified)

backport to 1.13: fix printf("%s", NULL)

Revision 1.275 / (download) - annotate - [select for diffs], Tue Aug 9 15:09:27 2016 UTC (8 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.274: +3 -2 lines
Diff to previous 1.274 (unified) to selected 1.306 (unified)

fix printf("%s", NULL);
found while investigating an unrelated bug report from jsg@

Revision 1.274 / (download) - annotate - [select for diffs], Tue Jul 19 21:31:55 2016 UTC (8 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.273: +4 -25 lines
Diff to previous 1.273 (unified) to selected 1.306 (unified)

Remove the dependency on SQLite without loss of functionality.
Stop supporting systems that don't have mmap(3).
Drop the obsolete names_check() now that we deleted MLINKS.

Revision 1.273 / (download) - annotate - [select for diffs], Tue Jul 19 13:36:13 2016 UTC (8 years, 3 months ago) by schwarze
Branch: MAIN
Branch point for: VERSION_1_13
Changes since 1.272: +1 -7 lines
Diff to previous 1.272 (unified) to selected 1.306 (unified)

Use __attribute__((__format__ throughout.
Triggered by a smaller patch from Christos Zoulas.

While here, unify style, move several config tests to config.h,
and delete the useless MANDOC_CONFIG_H.

Revision 1.272 / (download) - annotate - [select for diffs], Fri Jul 15 19:33:01 2016 UTC (8 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.271: +2 -2 lines
Diff to previous 1.271 (unified) to selected 1.306 (unified)

To remove the const qualifier from a pointer to an object - either
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@.

Revision 1.271 / (download) - annotate - [select for diffs], Fri Jul 15 18:50:20 2016 UTC (8 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.270: +3 -4 lines
Diff to previous 1.270 (unified) to selected 1.306 (unified)

Fix previous: the mandocdb() prototype was already there, it just
hid among static functions, as noticed by tedu@ (my bad).

Revision 1.270 / (download) - annotate - [select for diffs], Fri Jul 15 18:03:45 2016 UTC (8 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.269: +4 -1 lines
Diff to previous 1.269 (unified) to selected 1.306 (unified)

add missing prototypes, no code change;
noticed by Christos Zoulas with -Wmissing-prototypes

Revision 1.269 / (download) - annotate - [select for diffs], Tue Jul 12 05:18:38 2016 UTC (8 years, 4 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_13_4
Changes since 1.268: +9 -1 lines
Diff to previous 1.268 (unified) to selected 1.306 (unified)

Add support for Mac OS X's sandbox_init(3) sandbox functionality, which
is marked as DEPRECATED in OS X after 2011 or so, but has not been
removed and has no replacement.

ok schwarze@

Revision 1.268 / (download) - annotate - [select for diffs], Sun Jul 10 14:05:13 2016 UTC (8 years, 4 months ago) by schwarze
Branch: MAIN
Changes since 1.267: +3 -3 lines
Diff to previous 1.267 (unified) to selected 1.306 (unified)

On OpenBSD, more(1) is actually less(1) with a small number of
compatibility features - so we can safely use more -T on OpenBSD.
But don't do that in the portable version: more -T is unlikely
to work elsewhere.
Issue reported by Svyatoslav Mishyn <juef at openmailbox dot org>.

Revision 1.267 / (download) - annotate - [select for diffs], Fri Jul 8 22:29:05 2016 UTC (8 years, 4 months ago) by schwarze
Branch: MAIN
Changes since 1.266: +2 -2 lines
Diff to previous 1.266 (unified) to selected 1.306 (unified)

ISO C99 7.19.2.5 doesn't like mixing putchar(3) and putwchar(3) on
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.

Revision 1.266 / (download) - annotate - [select for diffs], Wed May 18 22:36:00 2016 UTC (8 years, 5 months ago) by schwarze
Branch: MAIN
Changes since 1.265: +3 -3 lines
Diff to previous 1.265 (unified) to selected 1.306 (unified)

Do not hardcode "makewhatis" in a warning message, use BINM_MAKEWHATIS.
Patch from Peter Bray <pdb_ml at yahoo dot com dot au>.

Revision 1.265 / (download) - annotate - [select for diffs], Thu Apr 14 20:55:48 2016 UTC (8 years, 6 months ago) by schwarze
Branch: MAIN
Changes since 1.264: +9 -3 lines
Diff to previous 1.264 (unified) to selected 1.306 (unified)

Fix a process group race.

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@.

Revision 1.264 / (download) - annotate - [select for diffs], Wed Apr 13 12:26:25 2016 UTC (8 years, 7 months ago) by schwarze
Branch: MAIN
Changes since 1.263: +11 -9 lines
Diff to previous 1.263 (unified) to selected 1.306 (unified)

Give manuals in purely numerical sections priority over manuals of
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.

Revision 1.263 / (download) - annotate - [select for diffs], Sat Jan 16 22:30:33 2016 UTC (8 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.262: +2 -2 lines
Diff to previous 1.262 (unified) to selected 1.306 (unified)

unbreak reading from stdin after recent parse() restructuring;
patch from florian@

Revision 1.262 / (download) - annotate - [select for diffs], Fri Jan 8 02:53:13 2016 UTC (8 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.261: +5 -9 lines
Diff to previous 1.261 (unified) to selected 1.306 (unified)

Simplify the mparse_open() interface.
Just return the file descriptor or -1 on error;
there is just one kind of error anyway.
Suggested by Christos Zoulas (NetBSD).

Revision 1.261 / (download) - annotate - [select for diffs], Fri Jan 8 02:13:39 2016 UTC (8 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.260: +4 -2 lines
Diff to previous 1.260 (unified) to selected 1.306 (unified)

It was very surprising that a function called mparse_readfd()
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).

Revision 1.260 / (download) - annotate - [select for diffs], Tue Dec 15 17:38:45 2015 UTC (8 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.259: +11 -6 lines
Diff to previous 1.259 (unified) to selected 1.306 (unified)

pledge(2) style:
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.

Revision 1.259 / (download) - annotate - [select for diffs], Fri Nov 20 21:59:54 2015 UTC (8 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.258: +42 -19 lines
Diff to previous 1.258 (unified) to selected 1.306 (unified)

Fix multiple issues regarding process group and signal mask handling
found by tb@ and millert@; parts of the code, in particular in tag.c,
by millert@; OK millert@.

Revision 1.258 / (download) - annotate - [select for diffs], Sat Nov 14 23:57:47 2015 UTC (8 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.257: +35 -5 lines
Diff to previous 1.257 (unified) to selected 1.306 (unified)

Fix an issue reported by deraadt@:  When hitting Ctrl-Backslash (= SIGQUIT)
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@

Revision 1.257 / (download) - annotate - [select for diffs], Sat Nov 7 17:58:55 2015 UTC (9 years ago) by schwarze
Branch: MAIN
Changes since 1.256: +20 -24 lines
Diff to previous 1.256 (unified) to selected 1.306 (unified)

Modernization, no functional change intended:
Use the POSIX function getline(3) rather than the slightly
dangerous BSD function fgetln(3).
Remove the related compatibility code.

Revision 1.256 / (download) - annotate - [select for diffs], Sat Nov 7 14:22:29 2015 UTC (9 years ago) by schwarze
Branch: MAIN
Changes since 1.255: +3 -1 lines
Diff to previous 1.255 (unified) to selected 1.306 (unified)

Without HAVE_ERR, don't try to include <err.h>, it probably isn't there.
In that case, the required prototypes are in "config.h".
Patch from Peter Bray <pdb_ml at yahoo dot com dot au>.

Revision 1.255 / (download) - annotate - [select for diffs], Fri Nov 6 17:33:34 2015 UTC (9 years ago) by schwarze
Branch: MAIN
Changes since 1.254: +21 -1 lines
Diff to previous 1.254 (unified) to selected 1.306 (unified)

merge pledge(2) support from OpenBSD

Revision 1.254 / (download) - annotate - [select for diffs], Fri Nov 6 16:30:33 2015 UTC (9 years ago) by schwarze
Branch: MAIN
Changes since 1.253: +19 -16 lines
Diff to previous 1.253 (unified) to selected 1.306 (unified)

Use getprogname(3) rather than __progname.
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.

Revision 1.253 / (download) - annotate - [select for diffs], Thu Oct 22 21:54:23 2015 UTC (9 years ago) by schwarze
Branch: MAIN
Changes since 1.252: +2 -1 lines
Diff to previous 1.252 (unified) to selected 1.306 (unified)

move man(7) validation into the dedicated validation phase, too

Revision 1.252 / (download) - annotate - [select for diffs], Thu Oct 22 21:03:43 2015 UTC (9 years ago) by schwarze
Branch: MAIN
Changes since 1.251: +18 -16 lines
Diff to previous 1.251 (unified) to selected 1.306 (unified)

If no output device was allocated because no file wanted to produce output,
refrain from dereferencing a NULL pointer during final deallocation.
Fixing a recent regression reported by czarkoff@

Revision 1.251 / (download) - annotate - [select for diffs], Tue Oct 20 02:01:31 2015 UTC (9 years ago) by schwarze
Branch: MAIN
Changes since 1.250: +2 -1 lines
Diff to previous 1.250 (unified) to selected 1.306 (unified)

In order to become able to generate syntax tree nodes on the roff(7)
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.

Revision 1.250 / (download) - annotate - [select for diffs], Mon Oct 19 19:51:22 2015 UTC (9 years ago) by schwarze
Branch: MAIN
Changes since 1.249: +52 -36 lines
Diff to previous 1.249 (unified) to selected 1.306 (unified)

Simplify, no functional change:
Delete the outmdoc, outman, and outfree function pointers.

Revision 1.249 / (download) - annotate - [select for diffs], Tue Oct 13 22:59:54 2015 UTC (9 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.248: +10 -18 lines
Diff to previous 1.248 (unified) to selected 1.306 (unified)

Major character table cleanup:
* Use ohash(3) rather than a hand-rolled hash table.
* Make the character table static in the chars.c module:
There is no need to pass a pointer around, we most certainly
never want to use two different character tables concurrently.
* No need to keep the characters in a separate file chars.in;
that merely encourages downstream porters to mess with them.
* Sort the characters to agree with the mandoc_chars(7) manual page.
* Specify Unicode codepoints in hex, not decimal (that's the detail
that originally triggered this patch).
No functional change, minus 100 LOC, and i don't see a performance change.

Revision 1.248 / (download) - annotate - [select for diffs], Mon Oct 12 00:08:15 2015 UTC (9 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.247: +1 -6 lines
Diff to previous 1.247 (unified) to selected 1.306 (unified)

To make the code more readable, delete 283 /* FALLTHROUGH */ comments
that were right between two adjacent case statement.  Keep only
those 24 where the first case actually executes some code before
falling through to the next case.

Revision 1.247 / (download) - annotate - [select for diffs], Sun Oct 11 21:12:54 2015 UTC (9 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.246: +33 -50 lines
Diff to previous 1.246 (unified) to selected 1.306 (unified)

Finally use __progname, err(3) and warn(3).
That's more readable and less error-prone than fumbling around
with argv[0], fprintf(3), strerror(3), perror(3), and exit(3).

It's a bad idea to boycott good interfaces merely because standards
committees ignore them.  Instead, let's provide compatibility modules
for archaic systems (like commercial Solaris) that still don't have
them.  The compat module has an UCB Copyright (c) 1993...

Revision 1.246 / (download) - annotate - [select for diffs], Sat Oct 10 13:21:18 2015 UTC (9 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.245: +6 -4 lines
Diff to previous 1.245 (unified) to selected 1.306 (unified)

Decide whether to use_pager as early as possible,
in preparation for pledge(2); no functional change intended.

Revision 1.245 / (download) - annotate - [select for diffs], Tue Oct 6 18:32:19 2015 UTC (9 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.244: +21 -21 lines
Diff to previous 1.244 (unified) to selected 1.306 (unified)

modernize style: "return" is not a function

Revision 1.244 / (download) - annotate - [select for diffs], Tue Jul 28 18:38:55 2015 UTC (9 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.243: +33 -62 lines
Diff to previous 1.243 (unified) to selected 1.306 (unified)

Remove the hack of scrolling forward and backward with +G1G that
many (jmc@, millert@, espie@, deraadt@) considered revolting.
Instead, when using a pager, since we are using a temporary file
for tags anyway, use another temporary file for the formatted
page(s), as suggested by millert@ and similar to what the traditional
BSD man(1) did, except that we use only one single temporary output
file rather than one for each formatted manual page, such that
searching (both with / and :t) works across all the displayed files.

Revision 1.243 / (download) - annotate - [select for diffs], Tue Jul 21 03:26:21 2015 UTC (9 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.242: +12 -9 lines
Diff to previous 1.242 (unified) to selected 1.306 (unified)

When creation of the temporary tags file fails, call the pager
without the -T option, because otherwise the pager won't even start.
Fixing a bug reported by jca@.

While here, shorten the code by two lines
and delete one internal interface function.

Revision 1.242 / (download) - annotate - [select for diffs], Sun Jul 19 06:05:16 2015 UTC (9 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.241: +1 -5 lines
Diff to previous 1.241 (unified) to selected 1.306 (unified)

Do not fork and exec gunzip(1), just link with libz instead.
As discussed with deraadt@, that's cleaner and will help tame(2).
Something like this was also suggested earlier by bapt at FreeBSD.
Minus 50 lines of code, deleting one interface function (mparse_wait),
no functional change intended.

Revision 1.241 / (download) - annotate - [select for diffs], Sun Jul 19 00:07:42 2015 UTC (9 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.240: +6 -3 lines
Diff to previous 1.240 (unified) to selected 1.306 (unified)

If we aren't on a tty, clear the pager flag up front.
Just to clean up code structure, no functional change.

Revision 1.240 / (download) - annotate - [select for diffs], Sat Jul 18 05:47:32 2015 UTC (9 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.239: +2 -2 lines
Diff to previous 1.239 (unified) to selected 1.306 (unified)

Insist that manual page file name extensions must begin with a digit,
lest pkg.conf(5) be shown when pkg(5) is asked for;
issue reported by Michael Reed <m dot reed at mykolab dot com>.

Revision 1.239 / (download) - annotate - [select for diffs], Fri Jul 17 22:38:29 2015 UTC (9 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.238: +44 -27 lines
Diff to previous 1.238 (unified) to selected 1.306 (unified)

Initial, still somewhat experimental implementation to leverage
less(1) -T and :t ctags(1)-like functionality to jump to the
definitions of various terms inside manual pages.
To be polished in the tree, so bear with me and report issues.

Technically, if less(1) is used as a pager, information is collected
by the mdoc(7) terminal formatter, first stored using the ohash
library, then ultimately written to a temporary file which is passed
to less via -T.  No change intended for other output formatters or
when running without a pager.

Based on an idea from Kristaps using feedback from many, in particular
phessler@ nicm@ millert@ halex@ doug@ kspillner@ deraadt@.

Revision 1.238 / (download) - annotate - [select for diffs], Wed Apr 29 11:04:17 2015 UTC (9 years, 6 months ago) by schwarze
Branch: MAIN
Changes since 1.237: +3 -3 lines
Diff to previous 1.237 (unified) to selected 1.306 (unified)

Improve the error message in case somebody has configured an invalid PAGER.
Suggested by Lorenzo Beretta <lory dot fulgi at infinito dot it>.

Revision 1.237 / (download) - annotate - [select for diffs], Mon Apr 20 09:54:48 2015 UTC (9 years, 6 months ago) by schwarze
Branch: MAIN
Changes since 1.236: +10 -6 lines
Diff to previous 1.236 (unified) to selected 1.306 (unified)

Fix previous:  Don't let man(1) warn twice about non-existant names.
Again noticed by deraadt@.

Revision 1.236 / (download) - annotate - [select for diffs], Sun Apr 19 15:10:46 2015 UTC (9 years, 6 months ago) by schwarze
Branch: MAIN
Changes since 1.235: +3 -1 lines
Diff to previous 1.235 (unified) to selected 1.306 (unified)

If apropos(1) finds no match, print "nothing appropriate" to stderr
similar to what the old apropos did.
Requested by and OK deraadt@.

Revision 1.235 / (download) - annotate - [select for diffs], Sat Apr 18 16:34:25 2015 UTC (9 years, 6 months ago) by schwarze
Branch: MAIN
Changes since 1.234: +7 -6 lines
Diff to previous 1.234 (unified) to selected 1.306 (unified)

Profit from the unified struct roff_man and reduce the number of
arguments of mparse_result() by one.  No functional change.
Written on the ICE Bruxelles-Koeln on the way back from p2k15.

Revision 1.234 / (download) - annotate - [select for diffs], Sat Apr 18 16:06:40 2015 UTC (9 years, 6 months ago) by schwarze
Branch: MAIN
Changes since 1.233: +5 -5 lines
Diff to previous 1.233 (unified) to selected 1.306 (unified)

Replace the structs mdoc and man by a unified struct roff_man.
Almost completely mechanical, no functional change.
Written on the train from Exeter to London returning from p2k15.

Revision 1.233 / (download) - annotate - [select for diffs], Thu Apr 16 16:36:21 2015 UTC (9 years, 6 months ago) by schwarze
Branch: MAIN
Changes since 1.232: +3 -5 lines
Diff to previous 1.232 (unified) to selected 1.306 (unified)

shorten "outdated mandoc.db" warning message; requested by deraadt@

Revision 1.232 / (download) - annotate - [select for diffs], Fri Apr 3 08:46:17 2015 UTC (9 years, 7 months ago) by schwarze
Branch: MAIN
Changes since 1.231: +2 -2 lines
Diff to previous 1.231 (unified) to selected 1.306 (unified)

No need to hardcode /usr/bin/ as the path to more(1); helps portability.
We don't hardcode the paths to gunzip(1) and cmp(1) either.
Discussed with ajacoutot@.

Revision 1.231 / (download) - annotate - [select for diffs], Thu Apr 2 21:36:49 2015 UTC (9 years, 7 months ago) by schwarze
Branch: MAIN
Changes since 1.230: +4 -3 lines
Diff to previous 1.230 (unified) to selected 1.306 (unified)

First step towards parser unification:
Replace enum mdoc_type and enum man_type by a unified enum roff_type.
Almost mechanical, no functional change.
Written on the ICE train from Frankfurt to Bruxelles on the way to p2k15.

Revision 1.230 / (download) - annotate - [select for diffs], Fri Mar 27 21:33:20 2015 UTC (9 years, 7 months ago) by schwarze
Branch: MAIN
Changes since 1.229: +10 -9 lines
Diff to previous 1.229 (unified) to selected 1.306 (unified)

Actually use the new man.conf(5) "output" directive.
Additional functionality, yet minus 45 lines of code.

Revision 1.229 / (download) - annotate - [select for diffs], Fri Mar 27 17:37:25 2015 UTC (9 years, 7 months ago) by schwarze
Branch: MAIN
Changes since 1.228: +13 -11 lines
Diff to previous 1.228 (unified) to selected 1.306 (unified)

Parse the new man.conf(5) "output" directive.
The next step will be to actually use the parsed data.

Revision 1.228 / (download) - annotate - [select for diffs], Fri Mar 27 16:36:31 2015 UTC (9 years, 7 months ago) by schwarze
Branch: MAIN
Changes since 1.227: +4 -4 lines
Diff to previous 1.227 (unified) to selected 1.306 (unified)

Modernize documentation by inserting blanks between option letters
and option arguments, except for -m because "-m an" and "-m andoc"
look just too weird.  Of course, the traditional form without the
blank will continue to work.

Revision 1.227 / (download) - annotate - [select for diffs], Tue Mar 17 13:35:52 2015 UTC (9 years, 7 months ago) by schwarze
Branch: MAIN
Changes since 1.226: +20 -27 lines
Diff to previous 1.226 (unified) to selected 1.306 (unified)

Simplify: Now that rc is global anyway, no need to pass it around
as an argument.  No functional change.

Revision 1.226 / (download) - annotate - [select for diffs], Tue Mar 17 07:33:07 2015 UTC (9 years, 7 months ago) by schwarze
Branch: MAIN
Changes since 1.225: +13 -2 lines
Diff to previous 1.225 (unified) to selected 1.306 (unified)

When the user exits the pager before the pager has drained all input
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@.

Revision 1.225 / (download) - annotate - [select for diffs], Tue Mar 10 13:50:03 2015 UTC (9 years, 8 months ago) by schwarze
Branch: MAIN
CVS Tags: VERSION_1_13_3
Changes since 1.224: +23 -27 lines
Diff to previous 1.224 (unified) to selected 1.306 (unified)

We can keep track of the pager PID without additional complexity.
No functional change for now, but more robust in case anybody should
ever add additional child processes.

Revision 1.224 / (download) - annotate - [select for diffs], Tue Mar 10 03:02:28 2015 UTC (9 years, 8 months ago) by schwarze
Branch: MAIN
Changes since 1.223: +22 -4 lines
Diff to previous 1.223 (unified) to selected 1.306 (unified)

Fix a regression caused in rev. 1.212, reported by kristaps@:

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).

Revision 1.223 / (download) - annotate - [select for diffs], Fri Mar 6 09:24:59 2015 UTC (9 years, 8 months ago) by kristaps
Branch: MAIN
Changes since 1.222: +5 -3 lines
Diff to previous 1.222 (unified) to selected 1.306 (unified)

Allow compilation on Mac OS X, which doesn't have MACHINE defined.
While there, specify some casts to satisfy the compiler warnings.

OK schwarze@

Revision 1.222 / (download) - annotate - [select for diffs], Fri Feb 27 16:02:10 2015 UTC (9 years, 8 months ago) by schwarze
Branch: MAIN
Changes since 1.221: +20 -9 lines
Diff to previous 1.221 (unified) to selected 1.306 (unified)

When man(1) and apropos(1) look for a file man1/foo.1 but it's unavailable,
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>.

Revision 1.221 / (download) - annotate - [select for diffs], Mon Feb 16 16:23:54 2015 UTC (9 years, 8 months ago) by schwarze
Branch: MAIN
Changes since 1.220: +5 -17 lines
Diff to previous 1.220 (unified) to selected 1.306 (unified)

Delete the -V option.  It serves no purpose but keeps confusing people.

Keeping track of the versions of installed software is the job of
the package manager, not of the individual binaries.  If individual
binaries include version numbers, that tends to goad people into
writing broken configuration tests that inspect version numbers
instead of properly testing for features.

Revision 1.220 / (download) - annotate - [select for diffs], Tue Feb 10 08:05:30 2015 UTC (9 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.219: +2 -2 lines
Diff to previous 1.219 (unified) to selected 1.306 (unified)

trim trailing white space, no code change;
from Svyatoslav Mishyn <juef at openmailboxd dot org>, Crux Linux

Revision 1.219 / (download) - annotate - [select for diffs], Sat Feb 7 06:28:08 2015 UTC (9 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.218: +10 -7 lines
Diff to previous 1.218 (unified) to selected 1.306 (unified)

be more careful about argc == 0

Revision 1.218 / (download) - annotate - [select for diffs], Tue Feb 3 21:16:02 2015 UTC (9 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.217: +15 -41 lines
Diff to previous 1.217 (unified) to selected 1.306 (unified)

Enable the integrated man(1) even when database support is disabled,
using the file system lookup fallback code, also reducing the number
of preprocessor conditional directives.
Hopefully, it will make some small Linux distros happy.

Revision 1.217 / (download) - annotate - [select for diffs], Tue Jan 20 21:16:51 2015 UTC (9 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.216: +8 -4 lines
Diff to previous 1.216 (unified) to selected 1.306 (unified)

Split the -Werror message level into -Werror (broken manual, probably
using mandoc is better than using groff) and -Wunsupp (manual using
unsupported low-level roff(7) feature, probably using groff is better
than using mandoc).  Once this feature is complete, it is intended
to help porting, making the decision whether to USE_GROFF easier.

As a first step, distinguish four classes of roff(7) requests:
1. Supported (currently 24 requests)
2. Currently ignored because unimportant (120)  ->  no message
3. Ignored for good because insecure (14)  ->  -Werror
4. Currently unsupported (68)  ->  these trigger the new -Wunsupp messages

Revision 1.216 / (download) - annotate - [select for diffs], Fri Jan 16 21:15:05 2015 UTC (9 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.215: +6 -1 lines
Diff to previous 1.215 (unified) to selected 1.306 (unified)

Let man(1) show manuals for the current architecture by default,
and support the MACHINE environment variable as documented in man(1).
Missing feature reported by pascal@.

Revision 1.215 / (download) - annotate - [select for diffs], Thu Jan 15 04:26:39 2015 UTC (9 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.214: +3 -8 lines
Diff to previous 1.214 (unified) to selected 1.306 (unified)

Fatal errors no longer exist.
If a file can be opened, mandoc will produce some output;
at worst, the output may be almost empty.
Simplifies error handling and frees a message type for future use.

Revision 1.214 / (download) - annotate - [select for diffs], Wed Jan 14 21:27:17 2015 UTC (9 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.213: +13 -7 lines
Diff to previous 1.213 (unified) to selected 1.306 (unified)

if earlier files set a non-zero exit status,
do not allow later files to reset it to zero

Revision 1.213 / (download) - annotate - [select for diffs], Tue Jan 13 23:17:52 2015 UTC (9 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.212: +106 -5 lines
Diff to previous 1.212 (unified) to selected 1.306 (unified)

Be developer-friendly, 'cause OpenBSD devs like to:
cd /usr/src/share/man/man4; vi newdev.4 Makefile; make install; man newdev

When a manual is missing from an outdated database, let man(1)
show it anyway, using a KISS file system lookup as a fallback.
Requested by deraadt@.

87 new lines of code doesn't seem too much bloat to me.

Of course, keeping your mandoc.db(5) files up to date with makewhatis(8)
or weekly(8) is still required for apropos(1) to find your new pages.

Revision 1.212 / (download) - annotate - [select for diffs], Tue Jan 13 13:22:22 2015 UTC (9 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.211: +36 -25 lines
Diff to previous 1.211 (unified) to selected 1.306 (unified)

do not spawn a pager when there is no output; issue pointed out by deraadt@

Revision 1.211 / (download) - annotate - [select for diffs], Thu Jan 1 13:20:38 2015 UTC (9 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.210: +3 -2 lines
Diff to previous 1.210 (unified) to selected 1.306 (unified)

If man(1) only has one single argument, always interpret it as a name,
never as a section.  Who would have thought that people call their
manual pages 7z(1), 9c(1), 9p(1), and 9p(3)...
Patch from Sebastien Marie <semarie dash openbsd at latrappe dot fr>.

Revision 1.210 / (download) - annotate - [select for diffs], Wed Dec 31 16:52:39 2014 UTC (9 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.209: +6 -2 lines
Diff to previous 1.209 (unified) to selected 1.306 (unified)

When showing more than one formatted manual page, insert horizontal lines
between pages.  Suggested by Theo Buehler <theo at math dot ethz dot ch>.
Even in UTF-8 output mode, do not use fancy line drawing characters such
that you can easily use /^--- to skip to the next manual in your pager.

Revision 1.209 / (download) - annotate - [select for diffs], Sun Dec 21 14:49:28 2014 UTC (9 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.208: +8 -8 lines
Diff to previous 1.208 (unified) to selected 1.306 (unified)

Use -m for macro set selection in mandoc(1) mode only, not in man(1)
and apropos(1) mode.  While here, put a space character between
options and option arguments in error messages.
Both reported by Alessandro DE LAURENZIS <just22 dot adl at gmail dot com>.

Revision 1.208 / (download) - annotate - [select for diffs], Thu Dec 18 21:11:46 2014 UTC (9 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.207: +5 -3 lines
Diff to previous 1.207 (unified) to selected 1.306 (unified)

update usage() and the list of non-standard (i.e. non-posix) options;
from jmc@

Revision 1.207 / (download) - annotate - [select for diffs], Wed Dec 17 18:45:35 2014 UTC (9 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.206: +7 -6 lines
Diff to previous 1.206 (unified) to selected 1.306 (unified)

Be a bit more lenient in what to accept for section names given
as the first man(1) command line argument without -s:
Accept digits like "1", "2"; digit+letter like "3p", "1X"; and "n".
Issue reported by Svyatoslav Mishyn <juef at openmailbox dot org> (Crux Linux).

Revision 1.206 / (download) - annotate - [select for diffs], Mon Dec 15 18:05:57 2014 UTC (9 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.205: +5 -4 lines
Diff to previous 1.205 (unified) to selected 1.306 (unified)

Let "man n open" do the same as "man -s n open" again, that is,
show the open(n) Tcl manual, as documented in man(1).  Issue reported
by Svyatoslav Mishyn <juef at openmailbox dot org> (Crux Linux).

Revision 1.205 / (download) - annotate - [select for diffs], Thu Dec 11 19:19:35 2014 UTC (9 years, 11 months ago) by schwarze
Branch: MAIN
CVS Tags: VERSION_1_13_2
Changes since 1.204: +20 -5 lines
Diff to previous 1.204 (unified) to selected 1.306 (unified)

Guard some come needed for database support only by #if HAVE_SQLITE3.
Compiler warnings about unused code reported by wiz@NetBSD.

Revision 1.204 / (download) - annotate - [select for diffs], Tue Dec 9 09:14:33 2014 UTC (9 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.203: +5 -6 lines
Diff to previous 1.203 (unified) to selected 1.306 (unified)

Support choosing alternative binary and manual names from configure.local,
to help downstream distributions avoid naming conflicts.

Revision 1.203 / (download) - annotate - [select for diffs], Tue Dec 9 07:29:42 2014 UTC (9 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.202: +10 -1 lines
Diff to previous 1.202 (unified) to selected 1.306 (unified)

Integrate the makewhatis binary into the mandoc binary
just like we do it on OpenBSD.  Smaller and neater.
While here, let ./configure set INSTALL_TARGETS.

Revision 1.202 / (download) - annotate - [select for diffs], Fri Dec 5 21:55:04 2014 UTC (9 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.201: +23 -10 lines
Diff to previous 1.201 (unified) to selected 1.306 (unified)

implement help(1)

Revision 1.201 / (download) - annotate - [select for diffs], Tue Dec 2 11:31:51 2014 UTC (9 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.200: +2 -2 lines
Diff to previous 1.200 (unified) to selected 1.306 (unified)

Switch the default output mode from -Tascii to -Tlocale.
This doesn't change anything unless LC_CTYPE is set,
but it helps when running with LC_TYPE=something.UTF-8.

OK tedu@  and earlier positive feedback from:
bentley@ deraadt@ naddy@ stsp@  uqs@freebsd wiz@netbsd

Revision 1.200 / (download) - annotate - [select for diffs], Wed Nov 26 21:40:17 2014 UTC (9 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.199: +4 -8 lines
Diff to previous 1.199 (unified) to selected 1.306 (unified)

Simplify the mparse_open()/mparse_wait() interface.
Don't bother the user with the PID of the child process,
store it inside the opaque mparse handle.

Revision 1.199 / (download) - annotate - [select for diffs], Tue Nov 11 19:04:55 2014 UTC (10 years ago) by schwarze
Branch: MAIN
Changes since 1.198: +5 -1 lines
Diff to previous 1.198 (unified) to selected 1.306 (unified)

In man(1) mode without -a, stop searching after the first manual tree
that contained at least one match in order to not prefer mdoc(1) from
ports over mdoc(7).  As a bonus, this results in a speedup.

Revision 1.198 / (download) - annotate - [select for diffs], Tue Nov 11 02:43:41 2014 UTC (10 years ago) by schwarze
Branch: MAIN
Changes since 1.197: +2 -1 lines
Diff to previous 1.197 (unified) to selected 1.306 (unified)

Let -h imply -c (that is, not use the pager).
Usually, -h output is short, so the pager is just a nuisance.
Also, traditional man(1) does not use a pager for -h.
Triggered by a remark of deraadt@ on ICB.

Revision 1.197 / (download) - annotate - [select for diffs], Tue Nov 11 02:10:04 2014 UTC (10 years ago) by schwarze
Branch: MAIN
Changes since 1.196: +55 -15 lines
Diff to previous 1.196 (unified) to selected 1.306 (unified)

implement -h (synopsis only) for preformatted (cat) pages;
requested by tedu@

Revision 1.196 / (download) - annotate - [select for diffs], Thu Oct 30 17:15:28 2014 UTC (10 years ago) by schwarze
Branch: MAIN
Changes since 1.195: +3 -3 lines
Diff to previous 1.195 (unified) to selected 1.306 (unified)

add -K to usage() and wrap nicely; from jmc@

Revision 1.195 / (download) - annotate - [select for diffs], Tue Oct 28 17:36:19 2014 UTC (10 years ago) by schwarze
Branch: MAIN
Changes since 1.194: +20 -18 lines
Diff to previous 1.194 (unified) to selected 1.306 (unified)

Make the character table available to libroff so it can check the
validity of character escape names and warn about unknown ones.
This requires mchars_spec2cp() to report unknown names again.
Fortunately, that doesn't require changing the calling code because
according to groff, invalid character escapes should not produce
output anyway, and now that we warn about them, that's fine.

Revision 1.194 / (download) - annotate - [select for diffs], Sat Oct 25 01:03:52 2014 UTC (10 years ago) by schwarze
Branch: MAIN
Changes since 1.193: +29 -3 lines
Diff to previous 1.193 (unified) to selected 1.306 (unified)

integrate preconv(1) into mandoc(1);
enhances functionality and reduces code and docs by more than 300 lines

Revision 1.193 / (download) - annotate - [select for diffs], Sat Oct 18 15:57:34 2014 UTC (10 years ago) by schwarze
Branch: MAIN
Changes since 1.192: +5 -4 lines
Diff to previous 1.192 (unified) to selected 1.306 (unified)

plug file descriptor leaks on read or write failure;
hinted at by Steffen Nurpmeso <sdaoden at yandex dot com>.

Revision 1.192 / (download) - annotate - [select for diffs], Wed Sep 3 23:21:47 2014 UTC (10 years, 2 months ago) by schwarze
Branch: MAIN
Changes since 1.191: +23 -14 lines
Diff to previous 1.191 (unified) to selected 1.306 (unified)

Add *.gz support to apropos(1) -a, man(1), and even mandoc(1).
Implemented by moving the zip code from makewhatis(8) to the parser lib.

Revision 1.191 / (download) - annotate - [select for diffs], Wed Sep 3 18:09:14 2014 UTC (10 years, 2 months ago) by schwarze
Branch: MAIN
Changes since 1.190: +2 -2 lines
Diff to previous 1.190 (unified) to selected 1.306 (unified)

If a manual page is installed gzip(1)ed, let makewhatis(8) take
note in mandoc.db(5), such that man(1) -w and apropos(1) -w can
report the correct filename.
This is a prerequisite for letting apropos -a and man support
gzip'ed manuals in the future, which doesn't work yet.

Revision 1.190 / (download) - annotate - [select for diffs], Wed Sep 3 05:22:45 2014 UTC (10 years, 2 months ago) by schwarze
Branch: MAIN
Changes since 1.189: +9 -5 lines
Diff to previous 1.189 (unified) to selected 1.306 (unified)

Implement the traditional -h option for man(1): show the SYNOPSIS only.
As usual, we get mandoc -h and apropos -h for free.
Try stuff like "apropos -h In=dirent" or "apropos -h Fa=timespec".

Only useful for terminal output, so -Tps, -Tpdf, -Thtml ignore -h for now.

Revision 1.189 / (download) - annotate - [select for diffs], Mon Sep 1 22:45:53 2014 UTC (10 years, 2 months ago) by schwarze
Branch: MAIN
Changes since 1.188: +6 -4 lines
Diff to previous 1.188 (unified) to selected 1.306 (unified)

In man(1) mode, change to the right directory before starting the parser,
just like traditional man(1) does, such that .so links have a chance to
work.  After this point, we don't need the current directory for anything
else before exit, so we don't need to worry about getting back and we can
safely ignore failure.

Revision 1.188 / (download) - annotate - [select for diffs], Sat Aug 30 18:08:10 2014 UTC (10 years, 2 months ago) by schwarze
Branch: MAIN
Changes since 1.187: +14 -9 lines
Diff to previous 1.187 (unified) to selected 1.306 (unified)

Introduce a man(1) -l option as an alias for mandoc -a.
Basically, this does the same as man -l in Linux man-db.
The point is that now all functionality of the combined tool
is reachable from the man(1) command name:
apropos = man -k, whatis = man -f, mandoc = man -cl.

Originally suggested by Carsten dot Kunze at arcor dot de,
current maintainer of the Heirloom Documentation Tools.

While here, add various missing information to the usage()
and to the manuals.

Revision 1.187 / (download) - annotate - [select for diffs], Sat Aug 23 22:26:06 2014 UTC (10 years, 2 months ago) by schwarze
Branch: MAIN
Changes since 1.186: +9 -1 lines
Diff to previous 1.186 (unified) to selected 1.306 (unified)

without search results, skip the processing loops and the parser

Revision 1.186 / (download) - annotate - [select for diffs], Sat Aug 23 00:34:59 2014 UTC (10 years, 2 months ago) by schwarze
Branch: MAIN
Changes since 1.185: +56 -20 lines
Diff to previous 1.185 (unified) to selected 1.306 (unified)

Let man(1) display preformatted manuals by simply reading them
from the file and copying them to the standard output.
This works even for mixed formats: "man -a groff mandoc" displays
groff(1) [formatted], mandoc(1) [unformatted], groff(7) [formatted],
and mandoc(7) [unformatted] in that order.

Revision 1.185 / (download) - annotate - [select for diffs], Fri Aug 22 18:07:15 2014 UTC (10 years, 2 months ago) by schwarze
Branch: MAIN
Changes since 1.184: +17 -1 lines
Diff to previous 1.184 (unified) to selected 1.306 (unified)

implement man(1) quirk: section argument without -s

Revision 1.184 / (download) - annotate - [select for diffs], Fri Aug 22 04:52:55 2014 UTC (10 years, 2 months ago) by schwarze
Branch: MAIN
Changes since 1.183: +49 -11 lines
Diff to previous 1.183 (unified) to selected 1.306 (unified)

implement MANPAGER and PAGER

Revision 1.183 / (download) - annotate - [select for diffs], Fri Aug 22 03:42:18 2014 UTC (10 years, 2 months ago) by schwarze
Branch: MAIN
Changes since 1.182: +53 -3 lines
Diff to previous 1.182 (unified) to selected 1.306 (unified)

mandoc -a, man, apropos -a, whatis -a now paginate by default
but provide an option -c to not paginate;
taking inspiration from manpage.c, hence adding (c) 2012 kristaps@

Revision 1.182 / (download) - annotate - [select for diffs], Thu Aug 21 00:32:15 2014 UTC (10 years, 2 months ago) by schwarze
Branch: MAIN
Changes since 1.181: +69 -8 lines
Diff to previous 1.181 (unified) to selected 1.306 (unified)

Implement classic man(1) output mode showing only one manual even
if there is more than one match, using traditional section priorities,
and implement man(1) -a (show all) output mode, not just for man(1),
but also for apropos(1) and whatis(1).

Revision 1.181 / (download) - annotate - [select for diffs], Wed Aug 20 21:04:35 2014 UTC (10 years, 2 months ago) by schwarze
Branch: MAIN
Changes since 1.180: +44 -5 lines
Diff to previous 1.180 (unified) to selected 1.306 (unified)

Parse the new -a, -i, and -w options.
Implement -w (list manual page filenames).

Revision 1.180 / (download) - annotate - [select for diffs], Sun Aug 17 03:24:47 2014 UTC (10 years, 2 months ago) by schwarze
Branch: MAIN
Changes since 1.179: +120 -37 lines
Diff to previous 1.179 (unified) to selected 1.306 (unified)

Fully integrate apropos(1) into mandoc(1).
Switch the argmode on the progname, including man(1).
Provide -f and -k options to switch the argmode.
Store the argmode inside struct search, generalizing the flags.
Derive the deftype from the argmode when needed instead of storing it.
Store the outkey inside struct search instead of passing it alone.
While here, get rid of the trailing blanks in Makefile.depend.

Revision 1.179 / (download) - annotate - [select for diffs], Sat Aug 16 23:04:25 2014 UTC (10 years, 2 months ago) by schwarze
Branch: MAIN
Changes since 1.178: +11 -1 lines
Diff to previous 1.178 (unified) to selected 1.306 (unified)

When BUILD_DB is active, link apropos(1) into the mandoc binary.
This is the first step on the way to a man(1) implementation.
The new ./configure is flexible enough to make this step quite easy.

Revision 1.178 / (download) - annotate - [select for diffs], Sun Aug 10 23:54:41 2014 UTC (10 years, 3 months ago) by schwarze
Branch: MAIN
CVS Tags: VERSION_1_12_4, VERSION_1_12
Changes since 1.177: +3 -3 lines
Diff to previous 1.177 (unified) to selected 1.306 (unified)

Get rid of HAVE_CONFIG_H, it is always defined; idea from libnbcompat.
Include <sys/types.h> where needed, it does not belong in config.h.
Remove <stdio.h> from config.h; if it is missing somewhere, it should
be added, but i cannot find a *.c file where it is missing.

Revision 1.177 / (download) - annotate - [select for diffs], Sat Jun 21 22:24:01 2014 UTC (10 years, 4 months ago) by schwarze
Branch: MAIN
CVS Tags: VERSION_1_13_1
Changes since 1.176: +6 -3 lines
Diff to previous 1.176 (unified) to selected 1.306 (unified)

Reduce the verbosity of error messages caused by open(2) failures.
Suggested by and ok jmc@.

Revision 1.176 / (download) - annotate - [select for diffs], Sat Jun 21 16:18:25 2014 UTC (10 years, 4 months ago) by schwarze
Branch: MAIN
Changes since 1.175: +11 -7 lines
Diff to previous 1.175 (unified) to selected 1.306 (unified)

Prefix messages about bad command line options and arguments
with "mandoc: " or "makewhatis: ", respectively,
similar to what we already do for other messages.

Revision 1.175 / (download) - annotate - [select for diffs], Fri Jun 20 23:02:31 2014 UTC (10 years, 4 months ago) by schwarze
Branch: MAIN
Changes since 1.174: +8 -4 lines
Diff to previous 1.174 (unified) to selected 1.306 (unified)

As suggested by jmc@, only include line and column numbers into messages
when they are meaningful, to avoid confusing stuff like this:
$ mandoc /dev/null
mandoc: /dev/null:0:1: FATAL: not a manual
Instead, just say:
mandoc: /dev/null: FATAL: not a manual

Another example this applies to is documents having a prologue,
but lacking a body.  Do not throw a FATAL error for these; instead,
issue a WARNING and show the empty document, in the man(7) case with
the same amount of blank lines as groff does.  Also downgrade mdoc(7)
documents having content before the first .Sh from FATAL to WARNING.

Revision 1.174 / (download) - annotate - [select for diffs], Fri Jun 20 16:11:42 2014 UTC (10 years, 4 months ago) by schwarze
Branch: MAIN
Changes since 1.173: +3 -2 lines
Diff to previous 1.173 (unified) to selected 1.306 (unified)

Prefix error messages from mandoc(1) with "mandoc: "
just like almost all other utility programs do.
Suggested by nick@ who wondered where messages came from
when calling mandoc(1) from inside a Perl script.
ok jmc@ nick@

Revision 1.173 / (download) - annotate - [select for diffs], Sun Apr 20 16:46:04 2014 UTC (10 years, 6 months ago) by schwarze
Branch: MAIN
Changes since 1.172: +44 -45 lines
Diff to previous 1.172 (unified) to selected 1.306 (unified)

KNF: case (FOO):  ->  case FOO:, remove /* LINTED */ and /* ARGSUSED */,
remove trailing whitespace and blanks before tabs, improve some indenting;
no functional change

Revision 1.172 / (download) - annotate - [select for diffs], Sun Mar 23 11:25:26 2014 UTC (10 years, 7 months ago) by schwarze
Branch: MAIN
Changes since 1.171: +2 -1 lines
Diff to previous 1.171 (unified) to selected 1.306 (unified)

The files mandoc.c and mandoc.h contained both specialised low-level
functions used for multiple languages (mdoc, man, roff), for example
mandoc_escape(), mandoc_getarg(), mandoc_eos(), and generic auxiliary
functions.  Split the auxiliaries out into their own file and header.
While here, do some #include cleanup.

Revision 1.171 / (download) - annotate - [select for diffs], Wed Mar 19 22:20:43 2014 UTC (10 years, 7 months ago) by schwarze
Branch: MAIN
Changes since 1.170: +2 -2 lines
Diff to previous 1.170 (unified) to selected 1.306 (unified)

Without the MPARSE_SO option, if the file contains nothing but a
single .so request, do not read the file pointed to, but instead
let mparse_result() provide the file name pointed to as a return
value.  To be used by makewhatis(8) in the future.

Revision 1.170 / (download) - annotate - [select for diffs], Wed Mar 19 21:51:20 2014 UTC (10 years, 7 months ago) by schwarze
Branch: MAIN
Changes since 1.169: +11 -11 lines
Diff to previous 1.169 (unified) to selected 1.306 (unified)

Generalize the mparse_alloc() and roff_alloc() functions by giving
them an "options" argument, replacing the existing "inttype" and
"quick" arguments, preparing for a future MPARSE_SO option.
Store this argument in struct mparse and struct roff, replacing the
existing "inttype", "parsetype", and "quick" members.
No functional change except one tiny cosmetic fix in roff_TH().

Revision 1.169 / (download) - annotate - [select for diffs], Mon Jan 6 00:53:33 2014 UTC (10 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.168: +2 -1 lines
Diff to previous 1.168 (unified) to selected 1.306 (unified)

Joerg Sonnenberger contributed copyrightable amounts of text to
some files.  To make it clear that he also put his contributions
under the ISC license, with his explicit permission, add his
Copyright notice to the relevant files.  No code change.

Revision 1.168 / (download) - annotate - [select for diffs], Sun Jan 5 20:26:36 2014 UTC (10 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.167: +2 -2 lines
Diff to previous 1.167 (unified) to selected 1.306 (unified)

Add an option -Q (quick) to mandocdb(8)
for accelerated generation of reduced-size databases.

Implement this by allowing the parsers to optionally
abort the parse sequence after the NAME section.

While here, garbage collect the unused void *arg attribute of
struct mparse and mparse_alloc() and fix some errors in mandoc(3).

This reduces the processing time of mandocdb(8) on /usr/share/man
by a factor of 2 and the database size by a factor of 4.
However, it still takes 5 times the time and 6 times the space
of makewhatis(8), so more work is clearly needed.

Revision 1.167 / (download) - annotate - [select for diffs], Mon Nov 19 17:22:26 2012 UTC (11 years, 11 months ago) by schwarze
Branch: MAIN
CVS Tags: VERSION_1_12_3, VERSION_1_12_2
Changes since 1.166: +4 -4 lines
Diff to previous 1.166 (unified) to selected 1.306 (unified)

sync usage(), and tidy up the output a little; from jmc@

Revision 1.166 / (download) - annotate - [select for diffs], Sun May 27 17:48:57 2012 UTC (12 years, 5 months ago) by schwarze
Branch: MAIN
Changes since 1.165: +20 -4 lines
Diff to previous 1.165 (unified) to selected 1.306 (unified)

Support -Ios='OpenBSD 5.1' to override uname(3) as the source of the
default value for the mdoc(7) .Os macro.
Needed for man.cgi on the OpenBSD website.

Problem with man.cgi first noticed by deraadt@;
beck@ and deraadt@ agree with the way to solve the issue.

"Please check them in and I'll look into them later!" kristaps@

Revision 1.165 / (download) - annotate - [select for diffs], Thu Oct 6 22:29:12 2011 UTC (13 years, 1 month ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_12_1, VERSION_1_12_0
Changes since 1.164: +8 -1 lines
Diff to previous 1.164 (unified) to selected 1.306 (unified)

If -Tman is specified and input is -man, echo the preprocessed (`so'
replaced by file) input.  This replaces earlier behaviour of doing
nothing, which I found unexpected (mandoc should always output).

This requires a buffer in read.c that saves the input lines before being
parsed, with a special hook if `so' is invoked.  This buffer is just
flushed to output if -mman is the input.

While mucking around doing this, I also alpha-ordered the mandoc.h
functions.

Ok schwarze@, with no screaming when the polished patch was published.

Revision 1.164 / (download) - annotate - [select for diffs], Sat Sep 17 15:00:51 2011 UTC (13 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.163: +7 -1 lines
Diff to previous 1.163 (unified) to selected 1.306 (unified)

Initial, incomplete support for -Tman
to convert mdoc(7) documents to the man(7) language.
This is work in progress and will be developed in tree.
It does already handle the cat(1) manual,
but will hardly handle all your fancy manuals yet.
go ahead  kristaps@ jmc@ millert@ deraadt@

Revision 1.163 / (download) - annotate - [select for diffs], Fri May 20 15:51:18 2011 UTC (13 years, 5 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_11_7, VERSION_1_11_6, VERSION_1_11_5, VERSION_1_11_4, VERSION_1_11_3
Changes since 1.162: +10 -1 lines
Diff to previous 1.162 (unified) to selected 1.306 (unified)

Turn on -Tutf8 in the frontend.  Here we go!

Revision 1.162 / (download) - annotate - [select for diffs], Tue May 17 14:38:34 2011 UTC (13 years, 5 months ago) by kristaps
Branch: MAIN
Changes since 1.161: +12 -2 lines
Diff to previous 1.161 (unified) to selected 1.306 (unified)

Add mode for -Tlocale.  This mode, with this commit, behaves exactly
like -Tascii.  While adding this, inline term_alloc() (was a one-liner),
remove some switches around the terminal encoding for the symbol table
(unnecessary), and split out ascii_alloc() into ascii_init(), which is
also called from locale_init().

Revision 1.161 / (download) - annotate - [select for diffs], Thu Mar 31 10:53:43 2011 UTC (13 years, 7 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_11_2, VERSION_1_11_1
Changes since 1.160: +2 -2 lines
Diff to previous 1.160 (unified) to selected 1.306 (unified)

Make -Werr be -Wlevel, keeping it in sync with mandoc.1.  Noted by
Alexander Schrijver---thanks!

Revision 1.160 / (download) - annotate - [select for diffs], Mon Mar 28 21:49:42 2011 UTC (13 years, 7 months ago) by kristaps
Branch: MAIN
Changes since 1.159: +3 -120 lines
Diff to previous 1.159 (unified) to selected 1.306 (unified)

Put mandocerrs and mandoclevels arrays into libmandoc with accessors
mparse_strerror() and mparse_strlevel().

Revision 1.159 / (download) - annotate - [select for diffs], Wed Mar 23 09:47:13 2011 UTC (13 years, 7 months ago) by kristaps
Branch: MAIN
Changes since 1.158: +2 -2 lines
Diff to previous 1.158 (unified) to selected 1.306 (unified)

Make (e.g.) `SM' before `B' be only a warning.  In reality, this refers
to ELINE macros ("next-line", but not unbreakable like the next-line
paragraph macros) followed by other macros.  This addresses a report by
Christian Weisgerber, posted in the TODO by schwarze@, and aired on
discuss@ (22/03/2011) for whether a fix is warranted.

Revision 1.158 / (download) - annotate - [select for diffs], Tue Mar 22 10:35:26 2011 UTC (13 years, 7 months ago) by kristaps
Branch: MAIN
Changes since 1.157: +2 -1 lines
Diff to previous 1.157 (unified) to selected 1.306 (unified)

Add a FATAL error for when no manual type was assigned (you can repeat
this for yourself by having a file consisting only of comments).

Revision 1.157 / (download) - annotate - [select for diffs], Mon Mar 21 12:04:26 2011 UTC (13 years, 7 months ago) by kristaps
Branch: MAIN
Changes since 1.156: +1 -2 lines
Diff to previous 1.156 (unified) to selected 1.306 (unified)

main.c doesn't need roff.h anymore.

Revision 1.156 / (download) - annotate - [select for diffs], Sun Mar 20 16:05:21 2011 UTC (13 years, 7 months ago) by kristaps
Branch: MAIN
Changes since 1.155: +2 -22 lines
Diff to previous 1.155 (unified) to selected 1.306 (unified)

Let read.c worry about the currently-open file instead of having this
information duplicated in main.c.  For the time being, remove evt_close
and evt_open, as the only known mparse interface (main.c) doesn't need
them.

Revision 1.155 / (download) - annotate - [select for diffs], Sun Mar 20 16:02:05 2011 UTC (13 years, 7 months ago) by kristaps
Branch: MAIN
Changes since 1.154: +9 -30 lines
Diff to previous 1.154 (unified) to selected 1.306 (unified)

Consolidate messages.  Have all parse-time messages (in libmdoc,
libroff, etc., etc.) route into mandoc_msg() and mandoc_vmsg(), for the
time being in libmandoc.h.  This requires struct mparse to be passed
into the allocation routines instead of mandocmsg and a void pointer.
Then, move some of the functionality of the old mmsg() into read.c's
mparse_mmsg() (check against wlevel and setting of file_status) and use
main.c's mmsg() as simply a printing tool.

Revision 1.154 / (download) - annotate - [select for diffs], Sun Mar 20 11:41:24 2011 UTC (13 years, 7 months ago) by kristaps
Branch: MAIN
Changes since 1.153: +70 -605 lines
Diff to previous 1.153 (unified) to selected 1.306 (unified)

Split the document parsing sequence out of main.c and into read.c,
putting the interface into mandoc.h.  This effectively makes the
function of main.c be command-line handling, invoking the parser, and
sending its output to the output handler.  The sequence of parsing
(pfile(), pdesc(), etc.) has changed very little but for clean-up of
some state variables (curp->fd, etc.).

Revision 1.153 / (download) - annotate - [select for diffs], Thu Mar 17 12:08:01 2011 UTC (13 years, 7 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_10_10
Changes since 1.152: +4 -6 lines
Diff to previous 1.152 (unified) to selected 1.306 (unified)

mandocmsg finally has no return value.

Revision 1.152 / (download) - annotate - [select for diffs], Thu Mar 17 08:49:34 2011 UTC (13 years, 7 months ago) by kristaps
Branch: MAIN
Changes since 1.151: +2 -6 lines
Diff to previous 1.151 (unified) to selected 1.306 (unified)

Move mandoc_{realloc,malloc,calloc} out of libmandoc.h and into mandoc.h
so that everybody can use them.  This follows the convention of
libXXXX.h being internal to a library and XXXX.h being the external
interface.  Not only does this allow the removal of lots of redundant
NULL-checking code, it also sets the tone for adding new mandoc-global
routines.

Revision 1.151 / (download) - annotate - [select for diffs], Wed Mar 16 15:28:35 2011 UTC (13 years, 7 months ago) by kristaps
Branch: MAIN
Changes since 1.150: +8 -7 lines
Diff to previous 1.150 (unified) to selected 1.306 (unified)

Push exit_status into struct curparse alongside file_status.

Revision 1.150 / (download) - annotate - [select for diffs], Tue Mar 15 16:23:51 2011 UTC (13 years, 8 months ago) by kristaps
Branch: MAIN
Changes since 1.149: +2 -2 lines
Diff to previous 1.149 (unified) to selected 1.306 (unified)

Make lint shut up a little bit.

Revision 1.149 / (download) - annotate - [select for diffs], Tue Mar 15 16:15:37 2011 UTC (13 years, 8 months ago) by kristaps
Branch: MAIN
Changes since 1.148: +1 -2 lines
Diff to previous 1.148 (unified) to selected 1.306 (unified)

Remove duplicate UNCONST definition.

Revision 1.148 / (download) - annotate - [select for diffs], Tue Mar 15 13:24:42 2011 UTC (13 years, 8 months ago) by kristaps
Branch: MAIN
Changes since 1.147: +28 -29 lines
Diff to previous 1.147 (unified) to selected 1.306 (unified)

Clean-up: make file_status global be local to curparse.  "I agree with
the direction of this particular patch", schwarze@.

Revision 1.147 / (download) - annotate - [select for diffs], Mon Mar 7 01:35:51 2011 UTC (13 years, 8 months ago) by schwarze
Branch: MAIN
Changes since 1.146: +3 -2 lines
Diff to previous 1.146 (unified) to selected 1.306 (unified)

Clean up date handling,
as a first step to get rid of the frequent petty warnings in this area:
 - always store dates as strings, not as seconds since the Epoch
 - for input, try the three most common formats everywhere
 - for unrecognized format, just pass the date though verbatim
 - when there is no date at all, still use the current date
Originally triggered by a one-line patch from Tim van der Molen,
<tbvdm at xs4all dot nl>, which is included here.
Feedback and OK on manual parts from jmc@.
"please check this in" kristaps@

Revision 1.146 / (download) - annotate - [select for diffs], Wed Feb 9 09:33:43 2011 UTC (13 years, 9 months ago) by kristaps
Branch: MAIN
Changes since 1.145: +14 -14 lines
Diff to previous 1.145 (unified) to selected 1.306 (unified)

Consolidate "rc" value in main.c around addspan, addeqn, and parseln.

Revision 1.145 / (download) - annotate - [select for diffs], Wed Feb 9 09:18:15 2011 UTC (13 years, 9 months ago) by kristaps
Branch: MAIN
Changes since 1.144: +6 -3 lines
Diff to previous 1.144 (unified) to selected 1.306 (unified)

Allow -man to process EQN as well.  Also fix a segfault in missing case
statements in the post-handler for EQN in -mdoc and -man.

Revision 1.144 / (download) - annotate - [select for diffs], Wed Feb 9 09:05:52 2011 UTC (13 years, 9 months ago) by kristaps
Branch: MAIN
Changes since 1.143: +4 -1 lines
Diff to previous 1.143 (unified) to selected 1.306 (unified)

Allow EQN data to be pushed down into libmdoc via mdoc_addeqn().  Only
the adding itself is implemented; equation data is not yet shown.

Revision 1.143 / (download) - annotate - [select for diffs], Sun Feb 6 20:36:36 2011 UTC (13 years, 9 months ago) by kristaps
Branch: MAIN
Changes since 1.142: +3 -1 lines
Diff to previous 1.142 (unified) to selected 1.306 (unified)

Add initial EQN support to mandoc.  This parses, then throws away, data
between EQ and EN roff blocks.  EQN is different from TBL in that data
after .EQ is unilaterally considered an equation until an .EN.  Thus,
there's no need to jump through hoops in having table spans and so on.
This is ONLY the parse code framework in libroff.  EQN is not yet passed
into the backends.

Revision 1.142 / (download) - annotate - [select for diffs], Wed Feb 2 21:40:45 2011 UTC (13 years, 9 months ago) by kristaps
Branch: MAIN
Changes since 1.141: +2 -1 lines
Diff to previous 1.141 (unified) to selected 1.306 (unified)

If `Ns' is specified on its own line, it should be ignored.  This is
shitty groff behaviour.  Do the same, but raise a warning to this
effect.  This from a TODO noted by schwarze@.

Revision 1.141 / (download) - annotate - [select for diffs], Tue Jan 25 12:24:27 2011 UTC (13 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.140: +8 -6 lines
Diff to previous 1.140 (unified) to selected 1.306 (unified)

Since tbl_data() can now produce multiple spans, let parsebuf()
generate man(7) or mdoc(7) nodes for all these spans,
not only for the last one.
Restores the horizontal lines in the cpu(4/hppa) tables.
ok kristaps@

Revision 1.140 / (download) - annotate - [select for diffs], Mon Jan 24 23:41:55 2011 UTC (13 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.139: +21 -4 lines
Diff to previous 1.139 (unified) to selected 1.306 (unified)

Skip carriage return before newline, if any.
As pointed out by Joerg Sonnenberger, this is useful
because we use mmap(3) and look for '\n' by hand.
"check it in" kristaps@

Revision 1.139 / (download) - annotate - [select for diffs], Sat Jan 22 13:16:02 2011 UTC (13 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.138: +2 -2 lines
Diff to previous 1.138 (unified) to selected 1.306 (unified)

When finding the roff .it request (line trap),
make it clear that you cannot use mandoc to format that page (yet).
Triggered by a report from brad@, ok kristaps@.

Revision 1.138 / (download) - annotate - [select for diffs], Wed Jan 12 15:50:42 2011 UTC (13 years, 10 months ago) by kristaps
Branch: MAIN
Changes since 1.137: +2 -1 lines
Diff to previous 1.137 (unified) to selected 1.306 (unified)

Make out-of-context `fi' invocations not cause an error, but just a
warning.  From a TODO by schwarze@, originally noted by Brad Smith.

Revision 1.137 / (download) - annotate - [select for diffs], Tue Jan 11 00:11:45 2011 UTC (13 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.136: +2 -1 lines
Diff to previous 1.136 (unified) to selected 1.306 (unified)

Refactoring in preparation for .rm support:
Unify parsing of names given as roff request arguments into a new
function roff_getname(), which is rather different from the parsing
function for normal arguments, mandoc_getarg(), because names cannot
be quoted and cannot contain whitespace or escaped characters.
The new function now throws an ERROR when finding escaped characters
in a name.
"I'm fine with this." kristaps@

Revision 1.136 / (download) - annotate - [select for diffs], Mon Jan 10 14:40:30 2011 UTC (13 years, 10 months ago) by kristaps
Branch: MAIN
Changes since 1.135: +2 -4 lines
Diff to previous 1.135 (unified) to selected 1.306 (unified)

First, make extra data cells be thrown away.  This makes "dp->layout"
always hold, which cleans up the table stuff a bit.

Second, set a "spans" value per data cell consisting of the number of
skipped TBL_CELL_SPAN layout cells.

Third, make tbl_term.c understand how to skip over spanned sections when
iterating over the header queue.

What remains is to calculate the widths of spanned cells.

Revision 1.135 / (download) - annotate - [select for diffs], Tue Jan 4 15:02:00 2011 UTC (13 years, 10 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_10_9
Changes since 1.134: +2 -1 lines
Diff to previous 1.134 (unified) to selected 1.306 (unified)

Support `T{' and `T}' data blocks.  When a standalone `T{' is
encountered as a line's last data cell, move into TBL_PART_CDATA mode
whilst leaving the cell's designation as TBL_DATA_NONE.  When new data
arrives that's not a standalone `T}', append it to the cell contends.
Close out and warn appropriately.

Revision 1.134 / (download) - annotate - [select for diffs], Tue Jan 4 12:06:21 2011 UTC (13 years, 10 months ago) by kristaps
Branch: MAIN
Changes since 1.133: +3 -1 lines
Diff to previous 1.133 (unified) to selected 1.306 (unified)

Fix to make horizontal spanners in the layout be properly printed.
mandoc also now warns (so does tbl(1)) if a horizontal spanner is
specified along with data.

While here, fix up some documentation and uncomment the tbl reference.

Revision 1.133 / (download) - annotate - [select for diffs], Mon Jan 3 23:53:51 2011 UTC (13 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.132: +3 -2 lines
Diff to previous 1.132 (unified) to selected 1.306 (unified)

Partial cleanup of argument count validation in mdoc(7):

* Do not segfault on empty .Db, .Rs, .Sm, and .St.
* Let check_count() really throw the requested level, not always ERROR.
* Downgrade most bad argument counts from ERROR to WARNING.
* And some related internal cleanup.

Looks fine to kristaps@.

Note that the macros using eerr_ge1() still need to be checked at a later
time; but as all the others are done, let's use what we already have.

Revision 1.132 / (download) - annotate - [select for diffs], Mon Jan 3 13:54:02 2011 UTC (13 years, 10 months ago) by kristaps
Branch: MAIN
Changes since 1.131: +9 -1 lines
Diff to previous 1.131 (unified) to selected 1.306 (unified)

Make sure we don't continue recursively parsing once we've exited with
failure (this had caused some segfaults with the new assert() call in
MAN_HALT and MDOC_HALT).

Revision 1.131 / (download) - annotate - [select for diffs], Sat Jan 1 22:27:08 2011 UTC (13 years, 10 months ago) by kristaps
Branch: MAIN
Changes since 1.130: +5 -1 lines
Diff to previous 1.130 (unified) to selected 1.306 (unified)

Add a warning if a data cell has no layout.  Also make -Ttree show this
with a little star next to the entry (yeah, this is mostly for testing).

Revision 1.130 / (download) - annotate - [select for diffs], Sat Jan 1 16:18:39 2011 UTC (13 years, 10 months ago) by kristaps
Branch: MAIN
Changes since 1.129: +2 -5 lines
Diff to previous 1.129 (unified) to selected 1.306 (unified)

More checks for proper table exit.

Revision 1.129 / (download) - annotate - [select for diffs], Sat Jan 1 15:45:18 2011 UTC (13 years, 10 months ago) by kristaps
Branch: MAIN
Changes since 1.128: +2 -1 lines
Diff to previous 1.128 (unified) to selected 1.306 (unified)

Add documentation bits for libroff's new roff_span().

Add bits to remember tbl's invocation point.

Add ERROR class message if no data's in the table.

Revision 1.128 / (download) - annotate - [select for diffs], Sat Jan 1 13:37:40 2011 UTC (13 years, 10 months ago) by kristaps
Branch: MAIN
Changes since 1.127: +14 -3 lines
Diff to previous 1.127 (unified) to selected 1.306 (unified)

Switch on tbl rows being added to the parse stream.  Here we go!

Revision 1.127 / (download) - annotate - [select for diffs], Wed Dec 29 14:38:14 2010 UTC (13 years, 10 months ago) by kristaps
Branch: MAIN
Changes since 1.126: +3 -1 lines
Diff to previous 1.126 (unified) to selected 1.306 (unified)

Merge, with considerable changes, tbl.bsd.lv's layout-handling code.

Revision 1.126 / (download) - annotate - [select for diffs], Wed Dec 29 01:16:57 2010 UTC (13 years, 10 months ago) by kristaps
Branch: MAIN
Changes since 1.125: +3 -1 lines
Diff to previous 1.125 (unified) to selected 1.306 (unified)

Significant update to options handling, which now departs almost
completely with the BSD.lv code due to performance issues and flat-out
errors.

Performance issues: functions called per character.  Ugly.

Flat-out errors: disallowing "reserved" tokens as arguments to those
options accepting arguments.

Also added are two mandoc.h error codes for general tbl syntax errors
and for bad options.

Revision 1.125 / (download) - annotate - [select for diffs], Wed Dec 22 11:38:17 2010 UTC (13 years, 10 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_10_8
Changes since 1.124: +2 -2 lines
Diff to previous 1.124 (unified) to selected 1.306 (unified)

Revert IGNPAR to a warning after clue-stick applied by schwarze@:
although technically-speaking a lost macro is an error (e.g.,
MANDOCERR_MACRO), casting out some extra whitespace (note, IGNPAR only
happens in conditions where whitespace already exists!) is hardly an
error matter.

Revision 1.124 / (download) - annotate - [select for diffs], Tue Dec 21 01:22:03 2010 UTC (13 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.123: +2 -2 lines
Diff to previous 1.123 (unified) to selected 1.306 (unified)

Sane behaviour for the growing of very small buffers:
Always grow at least to the minimum requested size.
Before this, a buffer of 1 byte was grown to 2 bytes,
which was too small and sometimes caused segfaults.
ok kristaps@

Revision 1.123 / (download) - annotate - [select for diffs], Wed Dec 15 23:39:40 2010 UTC (13 years, 10 months ago) by kristaps
Branch: MAIN
Changes since 1.122: +2 -2 lines
Diff to previous 1.122 (unified) to selected 1.306 (unified)

Add a "last child" member of struct mdoc_node.

Remove `Pp' or `Lp' if it is the FIRST or LAST child of an `Sh' or `Sh' body.

Make "skipping paragraph" be an error, not a warning, as information (an
invoked macro) is ignored.

Revision 1.122 / (download) - annotate - [select for diffs], Fri Dec 10 20:58:56 2010 UTC (13 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.121: +12 -3 lines
Diff to previous 1.121 (unified) to selected 1.306 (unified)

Abort endless loops during roff macro and string expansion.
For now, use the simplest conceivable approach, like groff does:
Just a fixed, ugly input stack limit.
"check it in" kristaps@

Revision 1.121 / (download) - annotate - [select for diffs], Mon Dec 6 16:55:35 2010 UTC (13 years, 11 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_10_7
Changes since 1.120: +53 -44 lines
Diff to previous 1.120 (unified) to selected 1.306 (unified)

Bring schwarze@'s mandoc.h and main.c errors and warnings entirely in sync,
except for the tbl one which will be the focus of later study.

Revision 1.120 / (download) - annotate - [select for diffs], Mon Dec 6 15:31:19 2010 UTC (13 years, 11 months ago) by kristaps
Branch: MAIN
Changes since 1.119: +2 -1 lines
Diff to previous 1.119 (unified) to selected 1.306 (unified)

Add support for `ft' macro found in groff(7).  Based on a patch by
schwarze@, but without the -T[x]html handling, which structurally does
not work.  Also add man.7 documentation (not in original patch).

Revision 1.119 / (download) - annotate - [select for diffs], Mon Dec 6 11:01:19 2010 UTC (13 years, 11 months ago) by kristaps
Branch: MAIN
Changes since 1.118: +2 -1 lines
Diff to previous 1.118 (unified) to selected 1.306 (unified)

Merge schwarze@'s relaxation of scope-breaking rules: allow implicit
ending of scopes and drop stray scope-endings.

Revision 1.118 / (download) - annotate - [select for diffs], Sun Dec 5 15:55:01 2010 UTC (13 years, 11 months ago) by kristaps
Branch: MAIN
Changes since 1.117: +1 -2 lines
Diff to previous 1.117 (unified) to selected 1.306 (unified)

Remove long-standing FIXME regarding the consolidation of WIDTHARG and
NOARGV warnings.  From patch by schwarze@.

Revision 1.117 / (download) - annotate - [select for diffs], Sun Dec 5 15:49:37 2010 UTC (13 years, 11 months ago) by kristaps
Branch: MAIN
Changes since 1.116: +2 -2 lines
Diff to previous 1.116 (unified) to selected 1.306 (unified)

Merge schwarze@'s patch to allow uname() to fail without causing an exit.

Revision 1.116 / (download) - annotate - [select for diffs], Sun Dec 5 15:37:30 2010 UTC (13 years, 11 months ago) by kristaps
Branch: MAIN
Changes since 1.115: +2 -2 lines
Diff to previous 1.115 (unified) to selected 1.306 (unified)

Merge schwarze@'s changes allowing nested displays.  Tweak the patch by
making sure output doesn't add a superfluous newline with the nested displays.
Also add a COMPATIBILITY note.

Rename a macro (DATESIZ) to be in line with OpenBSD (DATESIZE).

Revision 1.115 / (download) - annotate - [select for diffs], Thu Dec 2 20:41:46 2010 UTC (13 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.114: +19 -14 lines
Diff to previous 1.114 (unified) to selected 1.306 (unified)

Track the parser status both per file (file_status), such that
we can for example skip rendering on FATAL parsing errors,
and globally (exit_status), such that we know what to return.
Without this, following files produced no rendered output
once a single file suffered from a FATAL error.
Bug reported by kristaps@, fix by me.

Revision 1.114 / (download) - annotate - [select for diffs], Wed Dec 1 17:00:05 2010 UTC (13 years, 11 months ago) by kristaps
Branch: MAIN
Changes since 1.113: +4 -3 lines
Diff to previous 1.113 (unified) to selected 1.306 (unified)

Fix enum/int mixing.

Revision 1.113 / (download) - annotate - [select for diffs], Wed Dec 1 16:54:25 2010 UTC (13 years, 11 months ago) by kristaps
Branch: MAIN
Changes since 1.112: +3 -1 lines
Diff to previous 1.112 (unified) to selected 1.306 (unified)

Merge OpenBSD's `so' handling (plus some documentation).  Great work to
schwarze@ and joerg@ for his comments!

Revision 1.112 / (download) - annotate - [select for diffs], Wed Dec 1 16:28:23 2010 UTC (13 years, 11 months ago) by kristaps
Branch: MAIN
Changes since 1.111: +158 -87 lines
Diff to previous 1.111 (unified) to selected 1.306 (unified)

Fix a subtle error in the new main.c where the parse type (mdoc/man) was
being inherited during the parse sequence, making pset() meaningless.
Make sure that the mdoc/man curp pointer is set for each parse from a
persistent object.

This flushes out an obscure error where `man' pages called with `mdoc'
will parse and segfault due to a missing title.  Never happened earlier
because `mdoc' pages were guaranteed to have a prologue.  Fix this
later.

Also document the new main.c functions.  Please make sure these sort of
things are documented!  Throw in some whitespace to make things a bit
more readable.

Revision 1.111 / (download) - annotate - [select for diffs], Wed Dec 1 15:09:01 2010 UTC (13 years, 11 months ago) by kristaps
Branch: MAIN
Changes since 1.110: +214 -130 lines
Diff to previous 1.110 (unified) to selected 1.306 (unified)

Merge restructuring of main.c code.  This provided by schwarze@ and inspected
carefully by joerg@.  Merge roff.h header for compilation's sake (this is not
yet implemented in roff.c.).

THIS IS A BUGGY CHECK-IN.  The manual type is erroneously kept between runs
of the compiler.  This is a known bug.

Revision 1.110 / (download) - annotate - [select for diffs], Wed Dec 1 10:31:34 2010 UTC (13 years, 11 months ago) by kristaps
Branch: MAIN
Changes since 1.109: +2 -1 lines
Diff to previous 1.109 (unified) to selected 1.306 (unified)

Re-ordering of roff requests as per OpenBSD.

Made `rm' be an error (again, OpenBSD...).

Revision 1.109 / (download) - annotate - [select for diffs], Mon Nov 29 15:45:15 2010 UTC (13 years, 11 months ago) by kristaps
Branch: MAIN
Changes since 1.108: +2 -3 lines
Diff to previous 1.108 (unified) to selected 1.306 (unified)

Remove left-over rsord[] in mdoc_actions.c.

Remove MANDOCERR_BADLIB (not used).

Moved `St' handling from mdoc_action.c into mdoc_validate.c.

Moved relevant MDOC_LITERAL macros (`Dl', `Bd' subtypes) from
mdoc_action.c into mdoc_validate.c.

Revision 1.108 / (download) - annotate - [select for diffs], Mon Oct 11 15:46:19 2010 UTC (14 years, 1 month ago) by kristaps
Branch: MAIN
Changes since 1.107: +2 -2 lines
Diff to previous 1.107 (unified) to selected 1.306 (unified)

Use proper error for `An' multiple arguments.

Making IGNARGV be an ERROR, not a WARNING, as information is lost.

Revision 1.107 / (download) - annotate - [select for diffs], Mon Sep 27 09:26:27 2010 UTC (14 years, 1 month ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_10_6
Changes since 1.106: +2 -1 lines
Diff to previous 1.106 (unified) to selected 1.306 (unified)

Ignore double-`Pp' and `Pp' before `Bd' and `Bl' (unless -compact is
specified).

Revision 1.106 / (download) - annotate - [select for diffs], Sun Sep 26 20:22:28 2010 UTC (14 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.105: +2 -3 lines
Diff to previous 1.105 (unified) to selected 1.306 (unified)

If an explicit scope is still open at the end of an input file,
report an ERROR:  We can still render the page by just closing
the open scope, but it is likely that information will be missing
or document structure mangled.
Before, man(7) only reported a WARNING (which is dangerous because
we cannot be sure rendering is correct) and mdoc(7) ran into FATAL
(which is too drastic, there is no reason not to show what we have).
"looks good" kristaps@

Revision 1.105 / (download) - annotate - [select for diffs], Sat Sep 4 20:18:53 2010 UTC (14 years, 2 months ago) by kristaps
Branch: MAIN
Changes since 1.104: +9 -8 lines
Diff to previous 1.104 (unified) to selected 1.306 (unified)

Churny commit to quiet lint.  No functional changes.

Revision 1.104 / (download) - annotate - [select for diffs], Fri Aug 20 08:13:43 2010 UTC (14 years, 2 months ago) by schwarze
Branch: MAIN
Changes since 1.103: +9 -9 lines
Diff to previous 1.103 (unified) to selected 1.306 (unified)

fix previous: when bailing out due to -Wstop,
skip output functions, but not *_endparse;
problem reported by kristaps@

Revision 1.103 / (download) - annotate - [select for diffs], Fri Aug 20 01:02:07 2010 UTC (14 years, 2 months ago) by schwarze
Branch: MAIN
Changes since 1.102: +137 -230 lines
Diff to previous 1.102 (unified) to selected 1.306 (unified)

Implement a simple, consistent user interface for error handling.
We now have sufficient practical experience to know what we want,
so this is intended to be final:
- provide -Wlevel (warning, error or fatal) to select what you care about
- provide -Wstop to stop after parsing a file with warnings you care about
- provide consistent exit status codes for those warnings you care about
- fully document what warnings, errors and fatal errors mean
- remove all other cruft from the user interface, less is more:
- remove all -f knobs along with the whole -f option
- remove the old -Werror because calling warnings "fatal" is silly
- always finish parsing each file, unless fatal errors prevent that
This commit also includes a couple of related simplifications behind
the scenes regarding error handling.
Feedback and OK  kristaps@;  Joerg Sonnenberger (NetBSD) and
Sascha Wildner (DragonFly BSD) agree with the general direction.

Revision 1.102 / (download) - annotate - [select for diffs], Sun Aug 8 14:45:59 2010 UTC (14 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.101: +4 -3 lines
Diff to previous 1.101 (unified) to selected 1.306 (unified)

Make sure we really throw away non-ASCII characters.
For example, on OpenBSD without locale settings,
isgraph(3) returns true for some eight-bit characters.
ok kristaps@

Revision 1.101 / (download) - annotate - [select for diffs], Thu Jul 29 22:00:39 2010 UTC (14 years, 3 months ago) by joerg
Branch: MAIN
Changes since 1.100: +5 -1 lines
Diff to previous 1.100 (unified) to selected 1.306 (unified)

Use 0 for MAP_FILE if it doesn't exist. From Hans Rosenfeld.

Revision 1.100 / (download) - annotate - [select for diffs], Sun Jul 25 11:44:31 2010 UTC (14 years, 3 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_10_5
Changes since 1.99: +12 -3 lines
Diff to previous 1.99 (unified) to selected 1.306 (unified)

Initial PDF shim over PS.  This produces working PDF output with -Tpdf.
It's currently missing the xref table, so you'll get a warning in most
PDF viewers).  It also produces lots of redundant output, which will go
away once I get a better handle on the PDF spec.  The code doesn't
really touch any existing functionality; it's a bunch of conditionals
atop the -Tps (term_ps.c) implementation.  I'm checking it in now to
have it exist and be auditable.  It needs clean-up, polish, and general
care (and xref!).

Revision 1.99 / (download) - annotate - [select for diffs], Tue Jul 20 14:56:42 2010 UTC (14 years, 3 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_10_5_PREPDF
Changes since 1.98: +23 -1 lines
Diff to previous 1.98 (unified) to selected 1.306 (unified)

Strip non-graphable input characters from input.  The manuals
specifically say that this is not allowed, and were it allowed, output
would be inconsistent across output media (-Tps will puke,
non-your-charset terminals will puke, etc.).

With this done, simplify check_text() to only check escapes and for
tabs.  Add in a new tab warning, too.

Revision 1.98 / (download) - annotate - [select for diffs], Wed Jul 7 15:04:54 2010 UTC (14 years, 4 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_10_4
Changes since 1.97: +1 -2 lines
Diff to previous 1.97 (unified) to selected 1.306 (unified)

Re-constitution of `ds' symbol processing.  First, push the
roff_getstr() family of functions into roff.c with the "first_string"
directly in struct roff.  Second, pre-process each line for reserved
words in libroff, splicing and re-running a line if it has one (this
allows defined symbols to be macros).  Remove term.c's invocation of the
roff_getstrn() function.  Removed function documentation in roff.3 and
added roff.7 `ds' documentation.

Revision 1.97 / (download) - annotate - [select for diffs], Sun Jul 4 22:04:04 2010 UTC (14 years, 4 months ago) by schwarze
Branch: MAIN
Changes since 1.96: +3 -2 lines
Diff to previous 1.96 (unified) to selected 1.306 (unified)

Assert my copyright, making it explicit that i'm granting the same license
on those parts of the code and text that i have written as Kristaps is.
"fine with me" kristaps@

Revision 1.96 / (download) - annotate - [select for diffs], Fri Jul 2 12:54:33 2010 UTC (14 years, 4 months ago) by kristaps
Branch: MAIN
Changes since 1.95: +2 -2 lines
Diff to previous 1.95 (unified) to selected 1.306 (unified)

Stash `Bf' parameters into struct mdoc_bf.

Revision 1.95 / (download) - annotate - [select for diffs], Thu Jul 1 15:38:56 2010 UTC (14 years, 4 months ago) by schwarze
Branch: MAIN
Changes since 1.94: +4 -3 lines
Diff to previous 1.94 (unified) to selected 1.306 (unified)

Improve .Nm indentation in the SYNOPSIS;
kristaps@ will do the missing HTML part soon.
"looks nicer" jmc@
"seems perfect to me" sobrado@
"slap it in" kristaps@

Revision 1.94 / (download) - annotate - [select for diffs], Wed Jun 30 20:32:15 2010 UTC (14 years, 4 months ago) by schwarze
Branch: MAIN
Changes since 1.93: +43 -27 lines
Diff to previous 1.93 (unified) to selected 1.306 (unified)

improve error reporting:
* avoid error exit code after mere warnings
* add ERROR: and FATAL: to messages when appropriate
* sort the code in mmsg() to make it easier on the eye
* make the mandocerrs[] list easier to maintain
* update a few comments in mandoc.h
ok kristaps@

Revision 1.93 / (download) - annotate - [select for diffs], Tue Jun 29 14:53:14 2010 UTC (14 years, 4 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_10_3
Changes since 1.92: +2 -2 lines
Diff to previous 1.92 (unified) to selected 1.306 (unified)

Add in -Opaper=xxx support for -Tps postscript.  This doesn't have any
functional changes beyond the getsubopt() parse in term_ps.c.  If you
want to test this (it only does -Opaper=a4 and -Opaper=letter; adding
more is trivial), make sure you specify (e.g.) -sPAPERSIZE=a4 to gs(1).

Revision 1.92 / (download) - annotate - [select for diffs], Sun Jun 27 15:52:41 2010 UTC (14 years, 4 months ago) by kristaps
Branch: MAIN
Changes since 1.91: +10 -9 lines
Diff to previous 1.91 (unified) to selected 1.306 (unified)

Downstream maintainers: this removes UGLY!  I don't want diverging
functionality and UGLY works quite well thanks to schwarze@'s careful
attention.

This also backs out function-prototype changes for struct regset,
instead stuffing a pointer to the regset directly into struct
mdoc/man/roff.

Revision 1.91 / (download) - annotate - [select for diffs], Sat Jun 26 15:36:37 2010 UTC (14 years, 4 months ago) by kristaps
Branch: MAIN
Changes since 1.90: +3 -3 lines
Diff to previous 1.90 (unified) to selected 1.306 (unified)

Churn-ish check-in getting mdoc_parseln() and man_parseln() to accept a
const struct regset pointer.  No functionality.

Revision 1.90 / (download) - annotate - [select for diffs], Sat Jun 26 15:22:19 2010 UTC (14 years, 4 months ago) by kristaps
Branch: MAIN
Changes since 1.89: +6 -3 lines
Diff to previous 1.89 (unified) to selected 1.306 (unified)

First step of adding register support.  This is inspired by a significant
patch by schwarze@.  This commit adds support to libroff parsing `nr'
into register set defined in regs.h.  This will propogate into libmdoc
and libman in later commits.

Revision 1.89 / (download) - annotate - [select for diffs], Sat Jun 19 20:46:27 2010 UTC (14 years, 4 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_10_2
Changes since 1.88: +2 -2 lines
Diff to previous 1.88 (unified) to selected 1.306 (unified)

Churn as I finish email address migration kth.se -> bsd.lv.

Revision 1.88 / (download) - annotate - [select for diffs], Sat Jun 12 11:41:50 2010 UTC (14 years, 5 months ago) by kristaps
Branch: MAIN
Changes since 1.87: +2 -1 lines
Diff to previous 1.87 (unified) to selected 1.306 (unified)

Removed stipulation that an empty `Bd -offset' will default to 6n.  Not
sure where this came about.  Added regression tests to convince myself
that this is so.  Also consolidated COMPATIBILITY notes regarding `Bd'.
Added COMPATIBILITY note to the effect that old groff pukes on `Bd
-compact -ragged' (regression test will fail on old groff).

Revision 1.87 / (download) - annotate - [select for diffs], Sat Jun 12 10:09:19 2010 UTC (14 years, 5 months ago) by kristaps
Branch: MAIN
Changes since 1.86: +3 -2 lines
Diff to previous 1.86 (unified) to selected 1.306 (unified)

Added enum mdoc_disp (similar to enum mdoc_list).  Display types are now
only calculated once in mdoc_validate.c.

Noted that `Bd -file xxx' is not supported:  it now raises a fatal
warning.  This is noted in mdoc.7.

Empty `Bd' now defaults to LIST_ragged, which is not quite what groff
does, but close enough (gross just throws away the `Bd' and gets upset
when it encounters an `Ed').

Revision 1.86 / (download) - annotate - [select for diffs], Tue Jun 8 13:22:37 2010 UTC (14 years, 5 months ago) by kristaps
Branch: MAIN
Changes since 1.85: +3 -2 lines
Diff to previous 1.85 (unified) to selected 1.306 (unified)

No functionality changes: just restructuring.  Deprecated
terminal_free() in favour of ps_free() and ascii_free().  Moved ps_*()
functions into term_ps.c so that they don't clutter up term.c.

Revision 1.85 / (download) - annotate - [select for diffs], Mon Jun 7 20:57:09 2010 UTC (14 years, 5 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_10_1
Changes since 1.84: +25 -9 lines
Diff to previous 1.84 (unified) to selected 1.306 (unified)

First check-in of PostScript output.  This does not change any logic
within term.c, but does add a small shim over putchar() that switches on
the output engine.  Prints, for this initial version, only monospace and
without font decorations.  It's a start.

Revision 1.84 / (download) - annotate - [select for diffs], Mon Jun 7 10:52:44 2010 UTC (14 years, 5 months ago) by kristaps
Branch: MAIN
Changes since 1.83: +2 -2 lines
Diff to previous 1.83 (unified) to selected 1.306 (unified)

Add -Owidth=width option to mandoc -Tascii.  Asked for by joerg@ about a
thousand years ago.  Note that this is normalised to >=60.

Revision 1.83 / (download) - annotate - [select for diffs], Sun Jun 6 20:44:53 2010 UTC (14 years, 5 months ago) by joerg
Branch: MAIN
Changes since 1.82: +2 -2 lines
Diff to previous 1.82 (unified) to selected 1.306 (unified)

Add MAP_SHARED for mmap, at least NetBSD with DIAGNOSTIC is quite noisy
otherwise.

Revision 1.82 / (download) - annotate - [select for diffs], Thu Jun 3 13:44:36 2010 UTC (14 years, 5 months ago) by kristaps
Branch: MAIN
Changes since 1.81: +2 -2 lines
Diff to previous 1.81 (unified) to selected 1.306 (unified)

Consolidated list processing to a single loop in mdoc_validate.c.  This
relieves having to repeat running over the argument list in
mdoc_action.c and mdoc_validate.c.

Default to LIST_item for type-less lists (groff technically doesn't do
this: it just ignores the `It' lines altogether).

Make MANDOC_LISTTYPE be a recoverable error.

Revision 1.81 / (download) - annotate - [select for diffs], Tue Jun 1 14:54:37 2010 UTC (14 years, 5 months ago) by kristaps
Branch: MAIN
Changes since 1.80: +3 -3 lines
Diff to previous 1.80 (unified) to selected 1.306 (unified)

Spelling patches provided by Ulrich Spoerlein.

Revision 1.80 / (download) - annotate - [select for diffs], Mon May 31 23:40:25 2010 UTC (14 years, 5 months ago) by kristaps
Branch: MAIN
Changes since 1.79: +2 -2 lines
Diff to previous 1.79 (unified) to selected 1.306 (unified)

Cleanup post_bl_head() to use enum mdoc_list (avoid traversing that
list).

Reverted MANDOC_COLUMNS to be a bad-bad syntax error: we don't, and
apparently never have, allowed mixing of -column syntaxes.  This would
have segfaulted if encountered.

Revision 1.79 / (download) - annotate - [select for diffs], Mon May 17 22:11:42 2010 UTC (14 years, 5 months ago) by kristaps
Branch: MAIN
Changes since 1.78: +95 -79 lines
Diff to previous 1.78 (unified) to selected 1.306 (unified)

Enable the unified error/warning enumeration in mandoc.h that's
stringified in main.c.

Allow `An' to handle an argument and child (with a warning).

Allow `Rv' and `Ex' to work without a prior `Nm' as groff does (with a
warning).

Allow inconsistent column syntax to only raise a warning.

Revision 1.78 / (download) - annotate - [select for diffs], Sun May 16 22:28:33 2010 UTC (14 years, 5 months ago) by kristaps
Branch: MAIN
Changes since 1.77: +3 -3 lines
Diff to previous 1.77 (unified) to selected 1.306 (unified)

`ig' support in all its glory.  Try

  .ig ig
  asdf
  .ig
  fdsa
  ..

or

  .ig if
  asdf
  .if n \
  foo

for a laugh.  It all works.  Lots of regression tests supporting this
and documentation for the same.

Revision 1.77 / (download) - annotate - [select for diffs], Sun May 16 19:08:11 2010 UTC (14 years, 5 months ago) by kristaps
Branch: MAIN
Changes since 1.76: +2 -1 lines
Diff to previous 1.76 (unified) to selected 1.306 (unified)

Regression tests in place for `.if' in libroff.
Check against some strange `.if' constructs I missed.
Added initial roff.7 manual.

Revision 1.76 / (download) - annotate - [select for diffs], Sun May 16 10:59:36 2010 UTC (14 years, 5 months ago) by kristaps
Branch: MAIN
Changes since 1.75: +31 -9 lines
Diff to previous 1.75 (unified) to selected 1.306 (unified)

Allow roff_parseln() to be re-run.
Allow roff_parseln() to manipulate the line buffer offset.  This is used
in situations like `.ie n .TH FOO 1' or `.ie n .ie n', where the line
buffer offset is recalculated then the roff parser re-run.
Fix mdoc_parseln() and man_parseln() to accept the initial line offset.
WARNING: backed-out ALL roff macros whilst accomodating for how roff
handles multi-line conditionals (in short, re-running the parser).

Revision 1.75 / (download) - annotate - [select for diffs], Sun May 16 00:04:46 2010 UTC (14 years, 6 months ago) by kristaps
Branch: MAIN
Changes since 1.74: +2 -2 lines
Diff to previous 1.74 (unified) to selected 1.306 (unified)

Fix allowing silly '\'' control character.

Revision 1.74 / (download) - annotate - [select for diffs], Sat May 15 22:28:22 2010 UTC (14 years, 6 months ago) by kristaps
Branch: MAIN
Changes since 1.73: +3 -1 lines
Diff to previous 1.73 (unified) to selected 1.306 (unified)

Backed-out warning messages (lots).

Revision 1.73 / (download) - annotate - [select for diffs], Sat May 15 21:53:11 2010 UTC (14 years, 6 months ago) by kristaps
Branch: MAIN
Changes since 1.72: +15 -2 lines
Diff to previous 1.72 (unified) to selected 1.306 (unified)

The `ig' now supports `ig end-macro'.
Initial warning/error messages in place (still experimental).

Revision 1.72 / (download) - annotate - [select for diffs], Sat May 15 18:43:59 2010 UTC (14 years, 6 months ago) by kristaps
Branch: MAIN
Changes since 1.71: +2 -2 lines
Diff to previous 1.71 (unified) to selected 1.306 (unified)

Segfault fix and letting warnings slip through for now.

Revision 1.71 / (download) - annotate - [select for diffs], Sat May 15 18:35:14 2010 UTC (14 years, 6 months ago) by kristaps
Branch: MAIN
Changes since 1.70: +70 -18 lines
Diff to previous 1.70 (unified) to selected 1.306 (unified)

Add mandoc.h, which will eventually replace compilers' inner enum errors with unified ones.
Add initial roff pre-processor shim, a compiler sitting outside of the other compilers that processes pure roff instructions.

Revision 1.70 / (download) - annotate - [select for diffs], Sat May 15 16:20:12 2010 UTC (14 years, 6 months ago) by joerg
Branch: MAIN
Changes since 1.69: +53 -51 lines
Diff to previous 1.69 (unified) to selected 1.306 (unified)

Reorganise the comment stripping and line merging to be easier to follow
and slightly faster.

Revision 1.69 / (download) - annotate - [select for diffs], Sat May 15 16:18:23 2010 UTC (14 years, 6 months ago) by joerg
Branch: MAIN
Changes since 1.68: +2 -2 lines
Diff to previous 1.68 (unified) to selected 1.306 (unified)

Make the output width an option for ascii_alloc and use that to compute
the default margin. Hard-code 80 chars/line for now.

Revision 1.68 / (download) - annotate - [select for diffs], Sat May 15 09:46:31 2010 UTC (14 years, 6 months ago) by joerg
Branch: MAIN
Changes since 1.67: +25 -20 lines
Diff to previous 1.67 (unified) to selected 1.306 (unified)

Push buffer resizing into its own function.  Keep initial allocations the
same size as before.

Revision 1.67 / (download) - annotate - [select for diffs], Sat May 15 05:50:19 2010 UTC (14 years, 6 months ago) by joerg
Branch: MAIN
Changes since 1.66: +55 -57 lines
Diff to previous 1.66 (unified) to selected 1.306 (unified)

Cleanup indentation after moving the read buffering out of the loop.

Revision 1.66 / (download) - annotate - [select for diffs], Sat May 15 05:11:50 2010 UTC (14 years, 6 months ago) by kristaps
Branch: MAIN
Changes since 1.65: +131 -78 lines
Diff to previous 1.65 (unified) to selected 1.306 (unified)

"Push down the buffer to where they are used.
Handle the stdin/file argument in one function.
On top, use either mmap or if that failed reading the whole file into a
single buffer." (patches by Joerg Sonnenberger, ed. Kristaps)

Revision 1.65 / (download) - annotate - [select for diffs], Sat May 15 04:46:10 2010 UTC (14 years, 6 months ago) by kristaps
Branch: MAIN
Changes since 1.64: +1 -7 lines
Diff to previous 1.64 (unified) to selected 1.306 (unified)

Whacked lastman and lastmdoc (not being used).

Revision 1.64 / (download) - annotate - [select for diffs], Fri May 14 17:59:07 2010 UTC (14 years, 6 months ago) by kristaps
Branch: MAIN
Changes since 1.63: +62 -60 lines
Diff to previous 1.63 (unified) to selected 1.306 (unified)

"Accumulate errors and warnings in global variables and exit with error
if either is not null on exit." (patch by Joerg Sonnenberger)

Revision 1.63 / (download) - annotate - [select for diffs], Fri May 14 13:54:15 2010 UTC (14 years, 6 months ago) by kristaps
Branch: MAIN
Changes since 1.62: +3 -3 lines
Diff to previous 1.62 (unified) to selected 1.306 (unified)

Fix for Joerg's patch stripping of pre-comment whitespace (by Joerg).

Revision 1.62 / (download) - annotate - [select for diffs], Sun May 9 21:19:42 2010 UTC (14 years, 6 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_9_25
Changes since 1.61: +10 -20 lines
Diff to previous 1.61 (unified) to selected 1.306 (unified)

Remove -fno-ign-chars as well-argued by Ingo Schwarze.  Patch by Ingo Schwarze, too.

Revision 1.61 / (download) - annotate - [select for diffs], Mon Apr 12 19:27:22 2010 UTC (14 years, 7 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_9_24
Changes since 1.60: +9 -3 lines
Diff to previous 1.60 (unified) to selected 1.306 (unified)

Merge patch by Jason McIntyre cleaning on mandoc.1: `Ar' -> `Cm' and other readability fixes.
Merge modified patch by Joerg Sonnenberger that rewinds to whitespace when encountering trailing line-comments.

Revision 1.60 / (download) - annotate - [select for diffs], Mon Mar 22 20:43:00 2010 UTC (14 years, 7 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_9_23, VERSION_1_9_22, VERSION_1_9_21, VERSION_1_9_20, VERSION_1_9_19, VERSION_1_9_18, VERSION_1_9_17
Changes since 1.59: +38 -32 lines
Diff to previous 1.59 (unified) to selected 1.306 (unified)

Have -Tlint imply -Wall and -fstrict.  Based on a patch submitted by Ingo Schwarze.

Revision 1.59 / (download) - annotate - [select for diffs], Fri Jan 29 14:39:38 2010 UTC (14 years, 9 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_9_16, VERSION_1_9_15
Changes since 1.58: +10 -1 lines
Diff to previous 1.58 (unified) to selected 1.306 (unified)

Fixed Makefile for `make lint' dep. on config.h
Added -Txhtml for XHTML output (minimal increase to programme logic).  Because groff has it and it bothers me that we don't.

Revision 1.58 / (download) - annotate - [select for diffs], Fri Jan 1 17:14:27 2010 UTC (14 years, 10 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_9_15-pre2
Changes since 1.57: +5 -6 lines
Diff to previous 1.57 (unified) to selected 1.306 (unified)

Big check-in of compatibility layer.  This should work on most major architectures. Thanks to Joerg Sonnenberger.

Revision 1.57 / (download) - annotate - [select for diffs], Mon Nov 2 08:29:25 2009 UTC (15 years ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_9_15-pre1, VERSION_1_9_14, VERSION_1_9_13
Changes since 1.56: +5 -5 lines
Diff to previous 1.56 (unified) to selected 1.306 (unified)

Added forgotten newline terminators in main.c.

Revision 1.56 / (download) - annotate - [select for diffs], Mon Nov 2 08:13:48 2009 UTC (15 years ago) by kristaps
Branch: MAIN
Changes since 1.55: +4 -2 lines
Diff to previous 1.55 (unified) to selected 1.306 (unified)

Added lint to __attribute__ defines.

Revision 1.55 / (download) - annotate - [select for diffs], Mon Nov 2 08:08:23 2009 UTC (15 years ago) by kristaps
Branch: MAIN
Changes since 1.54: +10 -13 lines
Diff to previous 1.54 (unified) to selected 1.306 (unified)

Using straight-up __attribute__ (inspired by portable openssh).

Revision 1.54 / (download) - annotate - [select for diffs], Sat Oct 31 06:17:19 2009 UTC (15 years ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_9_12
Changes since 1.53: +10 -4 lines
Diff to previous 1.53 (unified) to selected 1.306 (unified)

Removed non-portable __progname (thanks Joerg Sonnenberger).

Revision 1.53 / (download) - annotate - [select for diffs], Sat Oct 31 06:10:57 2009 UTC (15 years ago) by kristaps
Branch: MAIN
Changes since 1.52: +14 -16 lines
Diff to previous 1.52 (unified) to selected 1.306 (unified)

Using perror() instead of fprintf for failure from library functions.

Revision 1.52 / (download) - annotate - [select for diffs], Fri Oct 30 05:58:37 2009 UTC (15 years ago) by kristaps
Branch: MAIN
Changes since 1.51: +5 -15 lines
Diff to previous 1.51 (unified) to selected 1.306 (unified)

libmdoc and libman now using non-recoverable allocations (simpler code).

Revision 1.51 / (download) - annotate - [select for diffs], Tue Oct 27 08:26:11 2009 UTC (15 years ago) by kristaps
Branch: MAIN
Changes since 1.50: +4 -4 lines
Diff to previous 1.50 (unified) to selected 1.306 (unified)

bzero() -> memset() (noted by Joerg Sonnenberger).

Revision 1.50 / (download) - annotate - [select for diffs], Mon Oct 26 15:44:51 2009 UTC (15 years ago) by kristaps
Branch: MAIN
Changes since 1.49: +7 -3 lines
Diff to previous 1.49 (unified) to selected 1.306 (unified)

Merged patch to allow -fign-escape (thanks Joerg Sonnenberger).

Revision 1.49 / (download) - annotate - [select for diffs], Mon Oct 26 08:42:37 2009 UTC (15 years ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_9_11, VERSION_1_9_10
Changes since 1.48: +5 -3 lines
Diff to previous 1.48 (unified) to selected 1.306 (unified)

Allowed -O to be invoked multiple times.

Revision 1.48 / (download) - annotate - [select for diffs], Mon Oct 26 08:18:16 2009 UTC (15 years ago) by kristaps
Branch: MAIN
Changes since 1.47: +4 -4 lines
Diff to previous 1.47 (unified) to selected 1.306 (unified)

Portability: replaced queue macros in html.c (Joerg Sonnenberger).
Fixed "-o" residue.
Added "-O" to usage() (-o didn't appear there either).

Revision 1.47 / (download) - annotate - [select for diffs], Mon Oct 26 04:15:42 2009 UTC (15 years ago) by kristaps
Branch: MAIN
Changes since 1.46: +2 -2 lines
Diff to previous 1.46 (unified) to selected 1.306 (unified)

Changed `-o' to `-O' for clarity.  THIS BREAKS UTILITIES DEPENDING ON -o!

Revision 1.46 / (download) - annotate - [select for diffs], Tue Oct 13 10:57:25 2009 UTC (15 years, 1 month ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_9_9
Changes since 1.45: +2 -12 lines
Diff to previous 1.45 (unified) to selected 1.306 (unified)

Moved output definitions into main.h.
Pushed terminal_{mdoc,man} into {mdoc,man}_term.c.

Revision 1.45 / (download) - annotate - [select for diffs], Tue Oct 13 10:21:24 2009 UTC (15 years, 1 month ago) by kristaps
Branch: MAIN
Changes since 1.44: +8 -5 lines
Diff to previous 1.44 (unified) to selected 1.306 (unified)

Clean up consts (noted by Joerg Sonnenberger and Ulrich Sporlein).

Revision 1.44 / (download) - annotate - [select for diffs], Mon Sep 21 13:06:13 2009 UTC (15 years, 1 month ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_9_8, VERSION_1_9_7, VERSION_1_9_6, VERSION_1_9_5
Changes since 1.43: +8 -12 lines
Diff to previous 1.43 (unified) to selected 1.306 (unified)

Removed new-born out.{h,c} (not a good idea).
Removed if 0 for HTML-mode output (why not).
Added option -oxxxx for passing options to output devices.

Revision 1.43 / (download) - annotate - [select for diffs], Wed Sep 16 22:17:27 2009 UTC (15 years, 1 month ago) by kristaps
Branch: MAIN
Changes since 1.42: +22 -1 lines
Diff to previous 1.42 (unified) to selected 1.306 (unified)

More updates to html.c.
Secretly enabled -Thtml in main.c (obviously not yet documented).

Revision 1.42 / (download) - annotate - [select for diffs], Wed Sep 16 09:41:24 2009 UTC (15 years, 1 month ago) by kristaps
Branch: MAIN
Changes since 1.41: +9 -11 lines
Diff to previous 1.41 (unified) to selected 1.306 (unified)

Made tree/term/out() functions return void.
Put err() functions back into front-ends (no use making it needlessly complex).

Revision 1.41 / (download) - annotate - [select for diffs], Tue Jul 28 10:15:12 2009 UTC (15 years, 3 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_9_2, VERSION_1_9_1, VERSION_1_9_0, VERSION_1_8_5
Changes since 1.40: +3 -2 lines
Diff to previous 1.40 (unified) to selected 1.306 (unified)

Fix in newline.
Correct printing of N-char predefined/special strings.

Revision 1.40 / (download) - annotate - [select for diffs], Mon Jul 27 19:43:02 2009 UTC (15 years, 3 months ago) by kristaps
Branch: MAIN
Changes since 1.39: +6 -7 lines
Diff to previous 1.39 (unified) to selected 1.306 (unified)

main.c using fprintf instead of warnx for parse errors (like cc).
Error string is now file:line:col: message.
Removed sed from vim -q example in manuals.7.
Fixed column reporting (off by one).

Revision 1.39 / (download) - annotate - [select for diffs], Fri Jul 24 14:00:59 2009 UTC (15 years, 3 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_8_4
Changes since 1.38: +28 -15 lines
Diff to previous 1.38 (unified) to selected 1.306 (unified)

Added -fign-errors for VERY fast checking of many manuals without stopping at errors.

Revision 1.38 / (download) - annotate - [select for diffs], Tue Jul 7 09:52:08 2009 UTC (15 years, 4 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_8_3, VERSION_1_8_2, VERSION_1_8_1, VERSION_1_8_0, VERSION_1_7_24, VERSION_1_7_23
Changes since 1.37: +2 -2 lines
Diff to previous 1.37 (unified) to selected 1.306 (unified)

Small clean-ups in error message usage.
Version.

Revision 1.37 / (download) - annotate - [select for diffs], Mon Jul 6 13:08:12 2009 UTC (15 years, 4 months ago) by kristaps
Branch: MAIN
Changes since 1.36: +5 -26 lines
Diff to previous 1.36 (unified) to selected 1.306 (unified)

Cleaned out duplicate {mdoc,man}warn in main.c.

Revision 1.36 / (download) - annotate - [select for diffs], Mon Jul 6 09:34:29 2009 UTC (15 years, 4 months ago) by kristaps
Branch: MAIN
Changes since 1.35: +11 -17 lines
Diff to previous 1.35 (unified) to selected 1.306 (unified)

Backed -Wcompat,syntax out of front-end.

Revision 1.35 / (download) - annotate - [select for diffs], Mon Jul 6 09:21:24 2009 UTC (15 years, 4 months ago) by kristaps
Branch: MAIN
Changes since 1.34: +5 -23 lines
Diff to previous 1.34 (unified) to selected 1.306 (unified)

Initial removal of enum mdoc_warn from mdoc warnings (unnecessary complication).

Revision 1.34 / (download) - annotate - [select for diffs], Sat Jul 4 11:10:36 2009 UTC (15 years, 4 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_7_22, VERSION_1_7_21
Changes since 1.33: +11 -7 lines
Diff to previous 1.33 (unified) to selected 1.306 (unified)

suboptarg is not portable to Linux (fixed).

Revision 1.33 / (download) - annotate - [select for diffs], Sat Jul 4 09:01:55 2009 UTC (15 years, 4 months ago) by kristaps
Branch: MAIN
Changes since 1.32: +4 -2 lines
Diff to previous 1.32 (unified) to selected 1.306 (unified)

Moved escape validation into libmandoc.h/mandoc.c (common between libman/libmdoc1).
libman supports MAN_IGN_ESCAPE (like MDOC_IGN_ESCAPE).
All popular escapes now handled consistently.

Revision 1.32 / (download) - annotate - [select for diffs], Sat Jun 27 09:03:03 2009 UTC (15 years, 4 months ago) by kristaps
Branch: MAIN
Changes since 1.31: +8 -8 lines
Diff to previous 1.31 (unified) to selected 1.306 (unified)

Removed escape-deprecation note (better solution in progress, schwarze@openbsd.org).
Using EXIT_FAILURE for parse errors (nicm@openbsd.org).
Fixed use of warn/warnx (nicm@openbsd.org).
Fixed use of getsubopt (nicm@openbsd.org).

Revision 1.31 / (download) - annotate - [select for diffs], Thu Jun 18 10:32:00 2009 UTC (15 years, 4 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_7_20
Changes since 1.30: +4 -2 lines
Diff to previous 1.30 (unified) to selected 1.306 (unified)

Added -fno-ign-chars support to libman.
man_validate.c checks for non-tab/isprint words.
libman hashtable fixed (was ignoring .br).
Added ncount field to man_node, deprecating count() functions.
Documented use of tabs in man.7.

Revision 1.30 / (download) - annotate - [select for diffs], Tue Jun 16 20:22:23 2009 UTC (15 years, 4 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_7_19
Changes since 1.29: +13 -56 lines
Diff to previous 1.29 (unified) to selected 1.306 (unified)

Clean-up: in-source documentation.

Revision 1.29 / (download) - annotate - [select for diffs], Tue Jun 16 19:13:28 2009 UTC (15 years, 4 months ago) by kristaps
Branch: MAIN
Changes since 1.28: +39 -26 lines
Diff to previous 1.28 (unified) to selected 1.306 (unified)

Modernised comment handling: text following \" is thrown away before
either parser is invoked.  Single-dot lines correctly handled.  This
confirms with both new- and old-groff.  "Comment" subsection added to
mdoc.7 and man.7.

Revision 1.28 / (download) - annotate - [select for diffs], Mon Jun 15 10:36:01 2009 UTC (15 years, 5 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_7_17
Changes since 1.27: +1 -2 lines
Diff to previous 1.27 (unified) to selected 1.306 (unified)

Deprecated mdoc_msg (not being used anywhere).

Revision 1.27 / (download) - annotate - [select for diffs], Thu Jun 11 12:07:49 2009 UTC (15 years, 5 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_7_16, VERSION_1_7_15, VERSION_1_7_14
Changes since 1.26: +32 -4 lines
Diff to previous 1.26 (unified) to selected 1.306 (unified)

Documented some un-clear parts of main.c.
Fixed footer to be new-groff style (OS DATE OS).
Removed sanity check from mdoc_term (unnecessary).

Revision 1.26 / (download) - annotate - [select for diffs], Wed Jun 10 20:18:43 2009 UTC (15 years, 5 months ago) by kristaps
Branch: MAIN
Changes since 1.25: +2 -2 lines
Diff to previous 1.25 (unified) to selected 1.306 (unified)

Fixed license email address.

Revision 1.25 / (download) - annotate - [select for diffs], Sun Apr 12 19:45:26 2009 UTC (15 years, 7 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_7_13
Changes since 1.24: +10 -12 lines
Diff to previous 1.24 (unified) to selected 1.306 (unified)

Using proper license template (const).

Revision 1.24 / (download) - annotate - [select for diffs], Sun Apr 12 19:19:57 2009 UTC (15 years, 7 months ago) by kristaps
Branch: MAIN
Changes since 1.23: +25 -18 lines
Diff to previous 1.23 (unified) to selected 1.306 (unified)

Manual .Dt fields CAPITALISED.
Indent set to 5 chars (nroff compat).
Half-indent set to 3 chars (nroff compat).
Default behaviour is loose-y (ignore macro/char/escape).
Added -fstrict.
Added unknown-character ignoring.

Revision 1.23 / (download) - annotate - [select for diffs], Fri Apr 3 12:27:18 2009 UTC (15 years, 7 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_7_12, VERSION_1_7_10, OPENBSD_CHECKIN
Changes since 1.22: +6 -7 lines
Diff to previous 1.22 (unified) to selected 1.306 (unified)

*** empty log message ***

Revision 1.22 / (download) - annotate - [select for diffs], Fri Apr 3 11:08:39 2009 UTC (15 years, 7 months ago) by kristaps
Branch: MAIN
Changes since 1.21: +97 -90 lines
Diff to previous 1.21 (unified) to selected 1.306 (unified)

Proper resetting of memory.
Array boundary fixed (-W).

Revision 1.21 / (download) - annotate - [select for diffs], Thu Apr 2 16:42:35 2009 UTC (15 years, 7 months ago) by kristaps
Branch: MAIN
Changes since 1.20: +1 -3 lines
Diff to previous 1.20 (unified) to selected 1.306 (unified)

Documented -mandoc behaviour.

Revision 1.20 / (download) - annotate - [select for diffs], Thu Apr 2 16:37:40 2009 UTC (15 years, 7 months ago) by kristaps
Branch: MAIN
Changes since 1.19: +12 -4 lines
Diff to previous 1.19 (unified) to selected 1.306 (unified)

Added -p1003.1-2008 specification.
Fixed invalid memory accesses (concat()).
Made -fign-macro be the default for libman.

Revision 1.19 / (download) - annotate - [select for diffs], Thu Apr 2 16:26:35 2009 UTC (15 years, 7 months ago) by kristaps
Branch: MAIN
Changes since 1.18: +212 -115 lines
Diff to previous 1.18 (unified) to selected 1.306 (unified)

Initial -mandoc auto-switch in place.

Revision 1.18 / (download) - annotate - [select for diffs], Tue Mar 31 13:50:19 2009 UTC (15 years, 7 months ago) by kristaps
Branch: MAIN
Changes since 1.17: +9 -7 lines
Diff to previous 1.17 (unified) to selected 1.306 (unified)

General clean-ups.

Revision 1.17 / (download) - annotate - [select for diffs], Thu Mar 26 16:23:22 2009 UTC (15 years, 7 months ago) by kristaps
Branch: MAIN
Changes since 1.16: +3 -3 lines
Diff to previous 1.16 (unified) to selected 1.306 (unified)

All macro-invocations, for consistency, begin with `.' in documentation.
Fixed \\ -> \e in manual documentation.
All preliminary -man macros in place.

Revision 1.16 / (download) - annotate - [select for diffs], Wed Mar 25 21:46:24 2009 UTC (15 years, 7 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_7_5
Changes since 1.15: +20 -33 lines
Diff to previous 1.15 (unified) to selected 1.306 (unified)

*** empty log message ***

Revision 1.15 / (download) - annotate - [select for diffs], Wed Mar 25 21:03:13 2009 UTC (15 years, 7 months ago) by kristaps
Branch: MAIN
Changes since 1.14: +22 -7 lines
Diff to previous 1.14 (unified) to selected 1.306 (unified)

Added pflags to man_alloc.
Abstract fflags -> pflags in main.c.

Revision 1.14 / (download) - annotate - [select for diffs], Wed Mar 25 15:17:49 2009 UTC (15 years, 7 months ago) by kristaps
Branch: MAIN
Changes since 1.13: +34 -9 lines
Diff to previous 1.13 (unified) to selected 1.306 (unified)

Added man validator, renamed mdoc validator.

Revision 1.13 / (download) - annotate - [select for diffs], Mon Mar 23 21:20:24 2009 UTC (15 years, 7 months ago) by kristaps
Branch: MAIN
Changes since 1.12: +2 -2 lines
Diff to previous 1.12 (unified) to selected 1.306 (unified)

Fixed inclusion of MANSRCS (sorry, Ulrich).
Added DragonFlyBSD __dead2.

Revision 1.12 / (download) - annotate - [select for diffs], Mon Mar 23 15:41:09 2009 UTC (15 years, 7 months ago) by kristaps
Branch: MAIN
Changes since 1.11: +4 -2 lines
Diff to previous 1.11 (unified) to selected 1.306 (unified)

-man linked to mandoc in documentation.

Revision 1.11 / (download) - annotate - [select for diffs], Mon Mar 23 15:20:51 2009 UTC (15 years, 7 months ago) by kristaps
Branch: MAIN
Changes since 1.10: +9 -10 lines
Diff to previous 1.10 (unified) to selected 1.306 (unified)

-man printing linked to -Ttree.

Revision 1.10 / (download) - annotate - [select for diffs], Mon Mar 23 14:22:11 2009 UTC (15 years, 7 months ago) by kristaps
Branch: MAIN
Changes since 1.9: +89 -103 lines
Diff to previous 1.9 (unified) to selected 1.306 (unified)

First addition of -man macro support.
Abstraction of mdoc.

Revision 1.9 / (download) - annotate - [select for diffs], Sun Mar 22 19:10:48 2009 UTC (15 years, 7 months ago) by kristaps
Branch: MAIN
Changes since 1.8: +3 -2 lines
Diff to previous 1.8 (unified) to selected 1.306 (unified)

Lint fixes.

Revision 1.8 / (download) - annotate - [select for diffs], Sun Mar 22 19:01:11 2009 UTC (15 years, 7 months ago) by kristaps
Branch: MAIN
Changes since 1.7: +82 -2 lines
Diff to previous 1.7 (unified) to selected 1.306 (unified)

Stripping of Xo/Xc macros in main.c (ifdef STRIP_XO).

Revision 1.7 / (download) - annotate - [select for diffs], Fri Mar 20 21:58:38 2009 UTC (15 years, 7 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_6_5
Changes since 1.6: +3 -3 lines
Diff to previous 1.6 (unified) to selected 1.306 (unified)

Lintification.

Revision 1.6 / (download) - annotate - [select for diffs], Fri Mar 20 21:29:29 2009 UTC (15 years, 7 months ago) by kristaps
Branch: MAIN
Changes since 1.5: +6 -6 lines
Diff to previous 1.5 (unified) to selected 1.306 (unified)

Casting fix.

Revision 1.5 / (download) - annotate - [select for diffs], Fri Mar 20 19:56:25 2009 UTC (15 years, 7 months ago) by kristaps
Branch: MAIN
Changes since 1.4: +58 -48 lines
Diff to previous 1.4 (unified) to selected 1.306 (unified)

Proper .Dl literalism.

Revision 1.4 / (download) - annotate - [select for diffs], Thu Mar 19 18:30:26 2009 UTC (15 years, 7 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_6_2
Changes since 1.3: +25 -11 lines
Diff to previous 1.3 (unified) to selected 1.306 (unified)

Fixed mandoc read from stdin.
Added some more groff_chars.

Revision 1.3 / (download) - annotate - [select for diffs], Thu Mar 19 16:40:49 2009 UTC (15 years, 7 months ago) by kristaps
Branch: MAIN
Changes since 1.2: +8 -1 lines
Diff to previous 1.2 (unified) to selected 1.306 (unified)

Some Linux-isms.

Revision 1.2 / (download) - annotate - [select for diffs], Thu Mar 19 16:18:36 2009 UTC (15 years, 7 months ago) by kristaps
Branch: MAIN
Changes since 1.1: +2 -1 lines
Diff to previous 1.1 (unified) to selected 1.306 (unified)

Lintified & versioned.

Revision 1.1 / (download) - annotate - [select for diffs], Thu Mar 19 16:17:27 2009 UTC (15 years, 7 months ago) by kristaps
Branch: MAIN
Diff to selected 1.306 (unified)

Split mdocterm.c -> main.c terminal.c.
Abstracted output with -T selector (default ascii).
Name change: mdocterm -> mandoc.
Re-imported tree with -Ttree.

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.




CVSweb