| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
by more specific messages, improving diagnostics for .cc .tr .Bl -column
|
| |
|
|
|
|
|
|
| |
* Do not print out macro names in tbl(7) data blocks.
* Like with GNU tbl, let empty tables cause a blank line.
* Avoid producing empty tables in -Tman.
|
|
|
|
|
|
| |
but stop throwing away their arguments. This fixes information loss in a
handful of Xenocara manuals, at the price of a small amount of formatting
noise creeping through.
|
|
|
|
|
| |
parser. Simplify the code by moving it into the roff(7) parser, also
making it work for mdoc(7).
|
|
|
|
|
|
| |
is sometimes harmless, it often causes seriously ugly output,
so flag these requests as unsupported rather than ignoring them.
Discussed with naddy@.
|
|
|
|
|
| |
scaling units, and some manuals (e.g. in devel/grcs) actually use that,
so let's support it. Missing feature reported by naddy@.
|
|
|
|
|
|
|
| |
Count special characters with the same width as ASCII characters
and treat all other escape sequences as if they had a width of 0.
Certainly not perfect, but a bit better.
For example, GNU RCS ci(1) needs this; reported by naddy@.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
| |
emits them, by default without defining them, relying on the roff(7)
quirk that undefined macros have no effect.
|
|
|
|
| |
allows to get rid of ROFF_ERR
|
|
|
|
|
| |
conditional request on the same input line, don't skip the first few
bytes of its content.
|
|
|
|
|
|
|
| |
an unclosed conditional body. If the memory contained the byte
sequence "\}" after the end of the buffer before the next NUL, this
could even write beyond the end of the buffer, specifically '&' to
the location of the '}'. Found by jsg@ with afl.
|
| |
|
|
|
|
|
|
| |
by limiting the length of expanded input lines during the
(usually recursive) expansion of user defined strings.
Resource hogging found by jsg@ with afl.
|
|
|
|
| |
Found by jsg@ with afl.
|
|
|
|
|
| |
would abort the table in an unclean way, causing assertion failures
found by jsg@.
|
|
|
|
|
|
|
|
| |
but ends without the final delimiter, the parse point was advanced
one character too far and the invalid pointer returned to the
caller of roff_parseln(). Later use could potentially advance
the pointer even further and maybe even write to it.
Fixing a buffer overrun found by jsg@ with afl (the most severe so far).
|
|
|
|
|
|
|
| |
character of input, treat it as false, do not retry it as a string
comparison condition. This also fixes a read buffer overrun that
happened when the numerical condition advanced to the end of the
input line before erroring out, found by jsg@ with afl.
|
|
|
|
|
|
| |
When negated, they still count as false.
Found when investigating crashes jsg@ found with afl.
Not completely fixing the crashes yet.
|
|
|
|
|
|
|
| |
for groff compatibility because pod2man(1) uses it that way.
Weirdly, groff documents it as "for compatibility with other
troff versions" but neither Heirloom nor Plan 9 have it.
Issue reported by giovanni@ via sthen@.
|
|
|
|
|
|
| |
and reduces the number of arguments of many functions.
While here, sprinkle some KNF.
No functional change.
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
| |
inside tables, sorry. So don't even try to parse tbl(7) blocks for
eqn(7) delimiters.
Broken table layout found in glPixelMap(3) while investigating
a bug report by Theo Buehler <theo at math dot ethz dot ch>.
|
|
|
|
|
|
|
| |
* drop trivial wrapper function roff_openeqn()
* drop unused first arg of function eqn_alloc()
* drop usused member "name" of struct eqn_node
While here, sync to OpenBSD by killing some trailing blanks.
|
| |
|
|
|
|
|
| |
at the beginning and at the end of input lines;
issue reported by kristaps@
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
Put the steering into the roff parser rather than into the mdoc
parser such that it works for all macro languages and on both text
and macro lines.
Line breaks and blank characters generated before and after in-line
equations are not perfect yet, but let's do one thing at a time.
|
|
|
|
| |
Daniel Levai reports that Slackware Linux uses this.
|
|
|
|
|
| |
in the roff parser instead of in three other places in other parsers.
No functional change.
|
|
|
|
|
|
|
|
|
|
|
| |
roff parser where .Dd and .TH are already detected, anyway. This
improves robustness because it correctly handles whitespace or an
alternate control character before Dd. In the parser dispatcher,
provide a fallback looking ahead in the input buffer instead of
always assuming man(7). This corrects autodetection when Dd is
preceded by other macros or macro-like handled requests like .ll.
Triggered by reports from Daniel Levai about issues on Slackware Linux.
|
|
|
|
| |
merge from OpenBSD, patch by daniel@
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
| |
and thus get rid of the last useless fatal error.
|
| |
|
|
|
|
| |
Hierarchical naming and mention macro names in messages.
|
| |
|
|
|
|
|
| |
* Mention invalid escape sequences and string names, and fallbacks.
* Hierarchical naming.
|
|
|
|
|
|
| |
* For \* and \n, discard the incomplete arg, expand to empty string.
* For \B, discard the incomplete arg, expand to the digit 0.
* For \w, use the incomplete arg (behaviour unchanged).
|
|
|
|
|
|
| |
* Downgrade ".Bf -emphasis Em" from FATAL to WARNING.
* Mention the macros, the arguments, and the fallbacks.
* Hierarchical naming.
|
|
|
|
| |
Split the roff(7) parts out of it and report the request names for these cases.
|
|
|
|
|
|
|
|
| |
when they immediately follow a request or macro name, without intervening
whitespace. Minimal fix.
The lesson learnt here is that, despite their appearance, \{ and \} are
not escape sequences, so never skip them when parsing for names.
|
|
|
|
|
|
|
|
| |
for the main roff request parsing routine, roff_parse().
In request or macro invocations, escape sequences now terminate the
request or macro name; what follows is treated as arguments. Besides,
the names of user-defined macros can now contain backslashes (eek!).
|
|
|
|
|
|
| |
for the .de parsing routine, roff_block(),
to correctly handle names terminated by escape sequences.
Besides, this saves us 20 lines of code.
|
|
|
|
|
|
|
|
|
| |
* Return the name even if it is terminated by an escape sequence, not a blank.
* Skip the full escape sequence using mandoc_escape(), not just the first byte.
* Make it non-destructive, return the length instead of writing a '\0'.
* Let .ds and .as cope with the above changes to the internal interface.
* Fix .rm and .rr to accept an escape sequence as the end of a name.
* Fix .nr and .rr to not set/delete a register with an empty name.
|
|
|
|
| |
Do not call strcmp() on an array of char that might not be NUL-terminated.
|