| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
making the mansearch() function easier to read for human auditors.
No functional change on OpenBSD.
As observed by Mark Millard <marklmi at yahoo dot com>, neither the
latest version of POSIX 2008 nor C11 defines what qsort(3) should do
for base == NULL && nmemb == 0.
My impression is it is indeed undefined behaviour because the
standards say that base shall point to an array, NULL does not point
to an array, and while there is special wording saying that compar()
shall not be called if nmemb == 0, i fail to see any similar wording
stating that base shall not be accessed if nmemb == 0.
Consequently, this patch is also likely to improve standard conformance
and portability.
Minor issue found by Stefan Esser <se at FreeBSD> with UBSAN.
He sent a patch to bugs@, but my patch differs in a minor way.
|
|
|
|
|
|
|
| |
output. In particular, do not represent "_" as "-", and distinguish "_"
from "\_" and "=" from "\=".
Output tweak following a related question from
Ted Bullock <tbullock at comlore dot com>.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
two character sequence "\_" or "\=", a single or double horizontal
line is supposed to be drawn inside the cell, not joining its
neighbours.
I am not aware of any way to do that with HTML and/or CSS.
Still, it seems closer to the intent of the document author to draw
a horizontal line with <hr/>, even though that line will join the
neighbour cells, rather than printing a literal '_' or '=' character.
Formatting tweak inspired by a related question from
Ted Bullock <tbullock at comlore dot com>.
|
|
|
|
|
|
|
|
| |
contains a backslash that needs to be escaped, and the
missing escaping resulted in very misleading formatting.
Documentation bug found due to a question from
Ted Bullock <tbullock at comlore dot com>.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
sequence in -T ps and -T pdf output mode, use an appropriate
horizontal distance by correctly using the term_len() utility
function. Output from the -T ascii, -T utf8, and -T html modes
was already correct and remains unchanged.
Lennart Jablonka <hummsmith42 at gmail dot com> found and reported
this unit conversion bug (misinterpreting AFM units as if they were
en units) when rendering scdoc-generated manuals (which is a low
quality generator, but that's no excuse for mandoc misformatting \h)
on Alpine Linux. Lennart also tested this patch.
|
|
|
|
| |
sytle -> style; adapted from changes by SAITOH masanobu (NetBSD)
|
|
|
|
|
|
|
|
|
|
|
| |
running with the -M option or with a MANPATH environment variable
that has neither a leading or trailing ":" nor any "::". If -M or
MANPATH override the configuration file rather than adding to it,
just ignore any "manpath" directives while processing the configuration
file.
This fixes a bug reported by Jan Stary <hans at stare dot cz>
on misc@.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
For open/openat, if the flags parameter does not contain O_CREAT, the
3rd (variadic) mode_t parameter is irrelevant. Many developers in the past
have passed mode_t (0, 044, 0644, or such), which might lead future people
to copy this broken idiom, and perhaps even believe this parameter has some
meaning or implication or application. Delete them all.
This comes out of a conversation where tb@ noticed that a strange (but
intentional) pledge behaviour is to always knock-out high-bits from
mode_t on a number of system calls as a safety factor, and his bewilderment
that this appeared to be happening against valid modes (at least visually),
but no sorry, they are all irrelevant junk. They could all be 0xdeafbeef.
ok millert
|
|
|
|
|
| |
variables that are already present (and used nearby) in the code;
no functional change
|
|
|
|
|
|
|
|
| |
A comment in the code claimed that the list of spans would be sorted,
but the sorting did not actually work. The layout "LSSS,LLSL" resulted
in the list "0-3, 1-2", whereas the layout "LLSL,LSSS" resulted
in the list "1-2, 0-3". Since sorting serves no purpose, just leave
the list unsorted.
|
| |
|
|
|
|
|
| |
that is malloc(3)ed. In addition to being less confusing, the new
code is also shorter by two lines.
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
| |
and resetting the internal state to the initial state.
Call this function from the proper place in term_free().
With the way the module is currently used, this does not imply any
functional change, but doing proper cleanup is more robust, makes
it easier during code review to understand what is going on, and
makes it explicit that there is no memory leak.
|
|
|
|
|
|
| |
struct together with similar state date rather than in a function-scope
static variable, such that it can be free(3)d in roff_man_free();
no functional change
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
a user-defined macro. Calls of standard mdoc(7) and man(7) macros
were unaffected, so the effect on OpenBSD manual pages was small,
about 80 Kilobytes grand total for a full run of "makewhatis
/usr/share/man".
Argument expansion contexts for user-defined macros are stored on
a stack that grows as needed if calls of user-defined macros are
nested or recursive. Individual stack entries contain dynamically
allocated arrays of pointers to arguments; these argument arrays
also grow as needed if user-defined macros take more than eight
arguments. The mistake was that argument arrays of already
initialized expansion contexts were leaked rather than reused on
subsequent macro calls.
I found this issue in a systematic hunt for memory leaks after
Michael <Stapelberg at Debian> reported memory exhaustion problems
on the production server manpages.debian.org. This sub-Megabyte
leak is not the cause of Michael's trouble, though, where Gigabytes
of memory are being wasted. We are still investigating whether the
original problem may be related to his supervisor process, which is
written in Go, rather than to mandoc.
|
| |
|
|
|
|
|
|
|
|
|
| |
reported by Michael <Stapelberg at Debian> in the Linux md(4) manual.
The reason the colwidth[] array is needed is not that it stores widths
different from those in tbl->cols[].width, but that only part of the
columns participate in the comparisons, i.e. only those intersecting
at least one span the still requires width distribution.
|
| |
|
|
|
|
| |
He is now busy with the early stages of development of Viewpoint Linux.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
For HTML generation, the "mandoc" prerequisite isn't needed anyway
because ${WWW_MANS} already explicitly depends on mandoc.
Issue reported by Sevan Janiyan and Leah Neukirchen.
This is not critical for release because it is only used for
a maintainer target. While here, i also fixed the associated
shell command to use the freshly built mandoc binary rather
than whatever may be in the $PATH.
|
| |
|
|
|
|
| |
suggested by Lukas Epple <sternenseemann at systemli dot org>
|
|
|
|
|
|
| |
in the "regress" target. That makes manual "cd regress && ./regress.pl"
a bit less fragile.
The idea came up in a conversation with Thomas Klausner <wiz at NetBSD>.
|
|
|
|
| |
bug reported by Thomas Klausner <wiz at NetBSD>
|
|
|
|
| |
Thomas Klausner <wiz at NetBSD> reported a compiler warning
|
| |
|
| |
|
|
|
|
| |
in case it is missing; needed for SUN Solaris 10.
|
|
|
|
|
|
|
| |
1. If mktemp(3) fails, do not overwrite the errno because
all errors mktemp(3) might return are also valid for mkdtemp(3).
2. If mkdir(2) fails, always put back the Xes, even if
the error is fatal and the function is about to return NULL.
|
|
|
|
| |
issue found on SUN Solaris 10
|
|
|
|
| |
issue found on Oracle Solaris 11
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
patch from jsg@
|
| |
|
|
|
|
| |
patch found in my tree, apparently forgotten years ago
|
| |
|
|
|
|
|
|
|
| |
With the "nospaces" option, skip space characters before and after "T{",
in addition to skipping those at the beginning and end of data cells.
Minor issue reported by <Oliver dot Corff at email dot de>.
|
|
|
|
| |
and remove two feature requests that were recently implemented
|
|
|
|
|
|
|
| |
not only at the end of data cells, but also after "T}",
aligning the behaviour of the parser with GNU tbl(1).
Issue reported by <Oliver dot Corff at email dot de>.
|
|
|
|
|
|
|
|
|
| |
on the right side with UTF-8 punctuation and figure spaces such
that numbers in different tbl(7) rows align at the decimal point.
The exact HTML output format was suggested
by <Oliver dot Corff at email dot de>;
the implementation in C is mine.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
only "_", "-", or "=", requesting a horizontal line to be drawn
across the middle of the cell, print <hr/> in that cell in HTML
output.
That is arguably slightly ugly because HTML 5 regards <hr/> as
semantic markup, meaning "thematic break". If somebody knowns
a better way to render a horizontal line across the middle of a
table cell with pure HTML and CSS, and without implying a specific
meaning, please tell me.
Missing feature reported by <Oliver dot Corff at email dot de>.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
overlapping horizontal spans. One span would calculate a desired
target width and start preparations for applying it to some columns,
then the other span would overwrite the target width with a different
value and also start preparations for applying that one to some
columns, which could sometimes confuse the code doing the final
distribution to the point of not doing anything at all before
entering the next iteration.
Fix this by making sure the distribution is done step by step, doing
one step at a time rather than allowing multiple steps to conflict.
Specifically, always do the smallest useful step first. This change
also simplifies the code. For example, the local "colwidth" array
is no longer needed.
Note that the algorithm still differs from the one implemented in
GNU tbl(1), which appears to not even try to harmonize column widths
but seems to simply distribute the same amount to all constituent
columns, no matter whether their intrinsic width is narrow or wide.
Adopting a GNU-compatible algorithm might allow further simplifiction
in addition to yielding even more similar output, but i do not want
to implement any major changes of the algorithm at this time.
The infinite loop was reported by <Oliver dot Corff at email dot de>.
|