| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
|
|
|
|
| |
quoted) in addition to the already supported \\$* (similar, but
unquoted). Then use \\$@ to improve the implementation of
the .als request (macro alias).
Needed by groff_hdtbl(7).
Gosh, it feels like the manual pages of the groff package are
exercising every bloody roff(7) feature under the sun. In the
manual page source code itself, not merely in the implementation
of the used macro packages, that is.
|
|
|
|
|
|
|
|
| |
before even reparsing the expanded macro.
That is the least dirty way to fix the bug that \(.$ remained set
after execution of the user-defined macro ended. Any other way
to fix it would probably require changes to read.c, which really
shouldn't be bothered with such roff(7) internals.
|
|
|
|
|
|
|
|
|
|
|
| |
roff conditional, except that the .char request still isn't supported
and that behaviour differs from groff in many edge cases.
But at least valid character names and numbers are now distinguished
from invalid ones.
This also fixes the bug that parsing of the 'c' conditional was
incomplete, which resulted in leaking the tested character to the
input parser at the beginning of the body when the condition was
inverted.
|
|
|
|
| |
because that turned it into a bogus line continuation.
|
|
|
|
| |
with comment); used for example by gropdf(1)
|
|
|
|
| |
used in most manual pages of the groff package
|
|
|
|
| |
used for example by groff_diff(7)
|
|
|
|
|
| |
by allowing the preprocessor to pass it through to the formatters.
Used for example by the groff_char(7) manual page.
|
|
|
|
|
| |
Examples of manual pages (ab)using it
include groff(7), chem(1), groff_mom(7), and groff_hdtbl(7).
|
|
|
|
|
|
| |
the parse point to the beginning of the new buffer or we risk out
of bounds accesses. Bug found by Leah Neukirchen <leah at vuxu dot
org> with valgrind on Void Linux.
|
|
|
|
| |
with mandoc -Tman; suggested by Thomas Klausner <wiz at NetBSD>
|
|
|
|
|
|
| |
* .nr optional third argument (auto-increment step size)
* \n+ and \n- numerical register auto-increment and -decrement
bentley@ reported on Dec 9, 2013 that lang/sbcl(1) uses these.
|
|
|
|
|
|
| |
the previous commit for strings and macros, only technically simpler.
Desired behaviour also mentioned by Werner Lemberg in 2011.
This diff adds functionality but is -21 +19 LOC. :-)
|
|
|
|
|
| |
Observed by Werner Lemberg on Nov 14, 2011
and rotting on my TODO list ever since.
|
|
|
|
| |
fixing tree corruption and assertion failure found by jsg@ with afl(1)
|
|
|
|
|
|
| |
unable to figure out that it is never used uninitialized.
While here, tweak the content of the variable to make its usage
easier to understand. No functional change.
|
|
|
|
| |
and use after free many ensue; again found by jsg@ with afl(1)
|
|
|
|
|
|
|
|
|
|
|
|
| |
right from roff_parseln() rather than delegating to read.c,
similar to what i just did for eqn(7).
The interface function roff_span() becomes obsolete and is deleted,
the former interface function roff_addtbl() becomes static,
the interface functions tbl_read() and tbl_cdata() become void,
and minus twelve linus of code.
No functional change.
|
|
|
|
| |
found by jsg@ with afl(1)
|
|
|
|
|
|
| |
of struct roff_node which is allocated for each equation anyway.
2. Do not keep a list of equation parsers, one parser is enough.
Minus fifty lines of code, no functional change.
|
|
|
|
| |
Cures bogus error messages in pages generated with pod2man(1).
|
|
|
|
| |
patch from bentley@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
-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@.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
With roff_getstrn(), provide finer control which definitions
can be used for what:
* All definitions can be used for .if d tests and .am appending.
* User-defined for \* expansion, .dei expansion, and macro calling.
* Predefined for \* expansion.
* Standard macros, original or renamed, for macro calling.
Several related improvements while here:
* Do not return string table entries that have explicitly been removed.
* Do not create a rentab entry when trying to rename a non-existent macro.
* Clear an existing rentab entry when the external interface
roff_setstr() is called with its name.
* Avoid trailing blanks in macro lines generated from renamed
and from aliased macros.
* Delete the duplicate __m*_reserved[] tables, just use roff_name[].
|
| |
|
| |
|
|
|
|
|
|
| |
This clearly works when .po is called on the top level, but might
not be sophisticated enough if people call .po inside indentation-changing
contexts, but i haven't seen that in manual pages (yet :).
|
|
|
|
| |
sufficient for pages using po4a(1)
|
| |
|
| |
|
|
|
|
|
|
| |
With the current code structure, they would appear at the wrong
place in the syntax tree, so it is better to not insert them
into the tree at all and issue an UNSUPP message instead.
|
|
|
|
|
| |
or this may crash with use-after-free in makewhatis(8);
reported by jmc@, thanks!
|
|
|
|
|
|
|
|
|
|
| |
Renaming a user-defined macro is very simple: just copy
the definition to the new name and delete the old name.
Renaming high-level macros is a bit tricky: use a dedicated
key-value-table, with non-standard names as keys and standard
names as values. When a macro is found that is not user-defined,
look it up in the "renamed" table and translate it back to the
standard name before passing it on to the high-level parsers.
|
|
|
|
|
| |
of input lines without filling).
Contrary to groff, high-level macros abort .ce mode for now.
|
|
|
|
|
|
| |
The Tcl/Tk manual pages use this extensively.
Delete the TERM_MAXMARGIN hack, it breaks .mc inside .nf;
instead, implement a proper TERMP_BRNEVER flag.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(escape character control), touching nothing after the preprocessing
stage and keeping even the state variable local to the preprocessor.
Since the escape character is also used for line continuation, this
requires pulling the implementation of line continuation from the
input reader to the preprocessor, which also considerably shortens
the code required for that.
When the escape character is changed, simply let the preprocessor
replace bare by escaped backslashes and instances of the non-standard
escape character with bare backslashes - that's all we need.
Oh, and if anybody dares to use these requests in OpenBSD manuals,
sending a medium-sized pack of axe-murderers after them might be a
worthwhile part of the punishment, but probably insuffient on its own.
|
|
|
|
|
|
| |
Considering that real roff implements next-line scope using input
line traps, that isn't all that surprising.
Issue found in the games/xbattle port.
|
|
|
|
| |
Needed by about four dozen ports (thanks to naddy@ for the research).
|
|
|
|
|
|
| |
This is the first feature made possible by the parser reorganization.
Improves the formatting of the SYNOPSIS in many Xenocara GL manuals.
Also important for ports, as reported by many, including naddy@.
|
|
|
|
| |
now that this actually saves code: -70 LOC.
|
| |
|
|
|
|
|
| |
modules to the new roff(7) modules. As a side effect,
mdoc(7) now handles .ft, too. Of course, do not use that.
|
|
|
|
|
| |
Generate the first node on the roff level: .br
Fix some column numbers in diagnostic messages while here.
|
|
|
|
| |
no functional change, minus two source files, minus 200 lines of code.
|
|
|
|
|
|
|
|
| |
* Make enum rofft an internal interface as enum roff_tok in "roff.h".
* Represent mdoc and man macros in enum roff_tok.
* Make TOKEN_NONE a proper enum value and use it throughout.
* Put the prologue macros first in the macro tables.
* Unify mdoc_macroname[] and man_macroname[] into roff_name[].
|
|
|
|
|
|
|
|
| |
consistent even when aborting the parsing of the line. That buffer
is not our own, but owned and reused by mparse_buf_r(), read.c.
Returning without cleanup leaked memory and caused write overruns
of the old, typically much smaller buffer in mparse_buf_r().
Promptly noticed by tb@ with afl(1), using MALLOC_OPTIONS=C.
|
|
|
|
| |
of a user-defined macro; issue found by tb@ with afl(1)
|
| |
|
|
|
|
| |
is empty; found by jsg@ with afl(1).
|
|
|
|
|
|
|
|
|
|
|
| |
text nodes when a string passed to deroff() ended in a backslash
and the byte after the terminating NUL was non-NUL, found by tb@
with afl(1).
Invalid bytes so copied with the high bit set could later sometimes
trigger another out of bounds read access to static memory in
roff_strdup(), so add an assertion there to abort safely in case
of similar data corruption.
|