CVS log for mandoc/mandoc_msg.c

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

Request diff between arbitrary revisions


Default branch: MAIN
Current tag: MAIN


Revision 1.20 / (download) - annotate - [select for diffs], Tue Jun 7 09:54:40 2022 UTC (21 months, 3 weeks ago) by schwarze
Branch: MAIN
CVS Tags: HEAD
Changes since 1.19: +2 -1 lines
Diff to previous 1.19 (unified) to selected 1.11 (unified)

Split the excessively generic diagnostic message "invalid escape sequence"
into the more specific messages "invalid escape argument delimiter"
and "invalid escape sequence argument".

Revision 1.19 / (download) - annotate - [select for diffs], Sun Jun 5 13:54:09 2022 UTC (21 months, 3 weeks ago) by schwarze
Branch: MAIN
Changes since 1.18: +5 -0 lines
Diff to previous 1.18 (unified) to selected 1.11 (unified)

With the improved escape sequence parser, it becomes easy to also improve
diagnostics.  Distinguish "incomplete escape sequence", "invalid special
character", and "unknown special character" from the generic "invalid
escape sequence", also promoting them from WARNING to ERROR because
incomplete escape sequences are severe syntax violations and because
encountering an invalid or unknown special character makes it likely
that part of the document content intended by the authors gets lost.

Revision 1.18 / (download) - annotate - [select for diffs], Thu Apr 28 16:21:09 2022 UTC (23 months ago) by schwarze
Branch: MAIN
Changes since 1.17: +2 -0 lines
Diff to previous 1.17 (unified) to selected 1.11 (unified)

The syntax of the roff(7) .mc request is quite special
and the roff_onearg() parsing function is too generic,
so provide a dedicated parsing function instead.

This fixes an assertion failure when an \o escape sequence is
passed as the argument; the bug was found by tb@ using afl(1).
It also makes mandoc output more similar to groff in various cases.

Revision 1.17 / (download) - annotate - [select for diffs], Sun Apr 24 13:38:46 2022 UTC (23 months ago) by schwarze
Branch: MAIN
Changes since 1.16: +2 -1 lines
Diff to previous 1.16 (unified) to selected 1.11 (unified)

If a .shift request has a negative argument, do not use a negative array
index but use 0 instead of the argument, just like groff.
Warn about the invalid argument.
While here, fix the column number in another warning message.

Segfault reported by tb@, found with afl(1).

Revision 1.16 / (download) - annotate - [select for diffs], Sat Aug 14 13:53:08 2021 UTC (2 years, 7 months ago) by schwarze
Branch: MAIN
CVS Tags: VERSION_1_14_6
Changes since 1.15: +1 -0 lines
Diff to previous 1.15 (unified) to selected 1.11 (unified)

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

Revision 1.15 / (download) - annotate - [select for diffs], Sun Jul 4 15:38:26 2021 UTC (2 years, 8 months ago) by schwarze
Branch: MAIN
Changes since 1.14: +3 -1 lines
Diff to previous 1.14 (unified) to selected 1.11 (unified)

The mandoc(1) manual already mentions that -T man output mode
neither supports tbl(7) nor eqn(7) input.
If an input file contains such code anyway, tell the user
rather than failing an assert(3)ion.

Fixing a crash reported by Bjarni Ingi Gislason <bjarniig at rhi dot hi dot is>
in https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=901636 which the
Debian maintainer of mandoc, Michael at Stapelberg dot ch, forwarded to me.

Revision 1.14 / (download) - annotate - [select for diffs], Sun Jun 27 17:57:54 2021 UTC (2 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.13: +1 -0 lines
Diff to previous 1.13 (unified) to selected 1.11 (unified)

add a style message about overlong text lines,
trying very hard to avoid false positives,
not at all trying to catch as many cases as possible;

feature originally suggested by tb@,
OK tb@ kn@ jmc@

Revision 1.13 / (download) - annotate - [select for diffs], Wed Jun 2 18:28:19 2021 UTC (2 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.12: +1 -1 lines
Diff to previous 1.12 (unified) to selected 1.11 (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.12 / (download) - annotate - [select for diffs], Tue Sep 1 18:25:27 2020 UTC (3 years, 6 months ago) by schwarze
Branch: MAIN
Changes since 1.11: +1 -0 lines
Diff to previous 1.11 (unified)

Ignore unreasonably large spacing modifiers in tbl layouts.

Jan Schreiber <jes at posteo dot de> ran afl on mandoc and it turned
out mandoc tried to use spacing modifiers so large that they would
trigger assertion failures in term_ascii.c, function locale_advance().

Revision 1.11 / (download) - annotate - [selected], Fri Apr 24 12:02:33 2020 UTC (3 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.10: +5 -2 lines
Diff to previous 1.10 (unified)

provide a STYLE message when mandoc knows the file name and the extension
disagrees with the section number given in the .Dt or .TH macro;
feature suggested and patch tested by jmc@

Revision 1.10 / (download) - annotate - [select for diffs], Sun Jan 19 18:02:00 2020 UTC (4 years, 2 months ago) by schwarze
Branch: MAIN
Changes since 1.9: +2 -1 lines
Diff to previous 1.9 (unified) to selected 1.11 (unified)

Introduce a new mdoc(7) macro .Tg ("tag") to explicitly mark a place
as defining a term.  Please only use it when automatic tagging does
not work.  Manual page authors will not be required to add the new
macro; using it remains optional.  HTML output is still rudimentary
in this version and will be polished later.

Thanks to kn@ for reminding me that i have been considering since
BSDCan 2014 whether something like this might be useful.  Given
that possibilities of making automatic tagging better are running
out and there are still several situations where automatic tagging
cannot do the job, i think the time is now ripe.

Feedback and no objection from millert@; OK espie@ inoguchi@ kn@.

Revision 1.9 / (download) - annotate - [select for diffs], Sun Jan 19 16:44:50 2020 UTC (4 years, 2 months ago) by schwarze
Branch: MAIN
Changes since 1.8: +3 -3 lines
Diff to previous 1.8 (unified) to selected 1.11 (unified)

Align to the new, sane behaviour of the groff_mdoc(7) .Dd macro:
without an argument, use the empty string, and always concatenate
all arguments, no matter their number.
This allows reducing the number of arguments of mandoc_normdate()
and some other simplifications, at the same time polishing some
error messages by adding the name of the macro in question.

Revision 1.8 / (download) - annotate - [select for diffs], Sun Jul 14 18:16:13 2019 UTC (4 years, 8 months ago) by schwarze
Branch: MAIN
Changes since 1.7: +10 -1 lines
Diff to previous 1.7 (unified) to selected 1.11 (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.7 / (download) - annotate - [select for diffs], Wed Jul 10 19:39:01 2019 UTC (4 years, 8 months ago) by schwarze
Branch: MAIN
Changes since 1.6: +36 -8 lines
Diff to previous 1.6 (unified) to selected 1.11 (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.6 / (download) - annotate - [select for diffs], Wed Mar 6 15:55:38 2019 UTC (5 years ago) by schwarze
Branch: MAIN
CVS Tags: VERSION_1_14_5
Changes since 1.5: +3 -1 lines
Diff to previous 1.5 (unified) to selected 1.11 (unified)

this file needs to #include "config.h" because it calls getprogname();
found while testing on Debian jessie

Revision 1.5 / (download) - annotate - [select for diffs], Thu Jan 10 06:29:00 2019 UTC (5 years, 2 months ago) by schwarze
Branch: MAIN
Changes since 1.4: +2 -2 lines
Diff to previous 1.4 (unified) to selected 1.11 (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.4 / (download) - annotate - [select for diffs], Sun Dec 16 00:21:05 2018 UTC (5 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.3: +1 -1 lines
Diff to previous 1.3 (unified) to selected 1.11 (unified)

s/OpenBSD/Id/ in CVS Ids

Revision 1.3 / (download) - annotate - [select for diffs], Sat Dec 15 19:30:26 2018 UTC (5 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.2: +2 -0 lines
Diff to previous 1.2 (unified) to selected 1.11 (unified)

Several improvements to escape sequence handling.

* Add the missing special character \_ (underscore).
* Partial implementations of \a (leader character)
and \E (uninterpreted escape character).
* Parse and ignore \r (reverse line feed).
* Add a WARNING message about undefined escape sequences.
* Add an UNSUPP message about unsupported escape sequences.
* Mark \! and \? (transparent throughput)
and \O (suppress output) as unsupported.
* Treat the various variants of zero-width spaces as one-byte escape
sequences rather than as special characters, to avoid defining bogus
forms with square brackets.
* For special characters with one-byte names, do not define bogus
forms with square brackets, except for \[-], which is valid.
* In the form with square brackets, undefined special characters do not
fall back to printing the name verbatim, not even for one-byte names.
* Starting a special character name with a blank is an error.
* Undefined escape sequences never abort formatting of the input
string, not even in HTML output mode.
* Document the newly handled escapes, and a few that were missing.
* Regression tests for most of the above.

Revision 1.2 / (download) - annotate - [select for diffs], Fri Dec 14 05:18:02 2018 UTC (5 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.1: +1 -11 lines
Diff to previous 1.1 (unified) to selected 1.11 (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.1 / (download) - annotate - [select for diffs], Fri Dec 14 01:18:26 2018 UTC (5 years, 3 months ago) by schwarze
Branch: MAIN
Diff to selected 1.11 (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.

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