| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
| |
found by Svyatoslav Mishyn <juef at openmailbox dot org> with cppcheck.
|
|
|
|
|
| |
Fixes a segfault reported by bentley@.
While here, do some style cleanup in the same function.
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
| |
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...
|
| |
|
|
|
|
| |
(didn't blow up anywhere yet, but better safe than sorry)
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
| |
No functional change except that for mdoc(7), it now skips leading
escape sequences just like it already did for man(7).
Escape sequences rarely occur in mdoc(7) code and if they do,
skipping them is an improvement in this context.
Minus 30 lines of code.
|
|
|
|
|
|
| |
man_node() from the mandoc(3) semi-public interface and the internal
wrapper functions print_mdoc() and print_man() from the HTML formatters.
Minus 60 lines of code, no functional change.
|
|
|
|
|
| |
arguments of mparse_result() by one. No functional change.
Written on the ICE Bruxelles-Koeln on the way back from p2k15.
|
|
|
|
|
| |
Almost completely mechanical, no functional change.
Written on the train from Exeter to London returning from p2k15.
|
|
|
|
|
| |
Replace struct mdoc_meta and struct man_meta by a unified struct roff_meta.
Written of the train from London to Exeter on the way to p2k15.
|
|
|
|
|
|
|
|
|
| |
Replace struct mdoc_node and struct man_node by a unified struct roff_node.
To be able to use the tok member for both mdoc(7) and man(7) without
defining all the macros in roff.h, sacrifice a tiny bit of type safety
and make tok an int rather than an enum.
Almost mechanical, no functional change.
Written on the Eurostar from Bruxelles to London on the way to p2k15.
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
The next step will be to actually use the parsed data.
|
|
|
|
|
|
| |
typically 64bit platforms. This was basically broken since forever.
Not only is the padding used, but it was used uninitialized.
Problem reported by jmc@.
|
|
|
|
|
|
|
|
|
|
| |
This is relevant because some ports install files like man1/xsel.1x,
as reported by patrick keshishian <pkeshish at gmail dot com> on misc@.
We can probably improve functionality and simplify the code by ignoring
file name extensions altogether; we already know the section number from
the name of the directory. But so close to lock, i'm keeping the fix
minimal.
|
|
|
|
| |
Idea found together with Alexis Hildebrandt <surryhill at gmail dot com>.
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
failure; found using detailed information provided by Ulrich Spoerlein
<uqs at FreeBSD> about FreeBSD Coverity CID 1261304.
|
|
|
|
|
|
|
| |
It is never dereferenced, but it gets copied around, which worries
static analysis tools and might also confuse human auditors.
FreeBSD Coverity CID 1261298, 1261299, 1261300, reported by
Pedro Giffuni and Ulrich Spörlein <pfg@ and uqs@ at FreeBSD>.
|
|
|
|
|
|
|
| |
relative to the respective manual tree is longer than PATH_MAX, do not
leak the memory allocated to hold the name. Not sure that can actually
happen, but better safe than sorry.
FreeBSD Coverity Scan CID 1261303, reported by Pedro Giffuni <pfg@>.
|
|
|
|
|
| |
just like we do it on OpenBSD. Smaller and neater.
While here, let ./configure set INSTALL_TARGETS.
|
|
|
|
| |
This gets rid of the last bogus entries in base and Xenocara.
|
|
|
|
| |
improves semantic analysis of more than 300 manuals.
|
|
|
|
|
| |
for different representations of the same string end up in the same
database entry. Improves name classification for 500 manuals.
|
|
|
|
|
| |
do not clobber the existing names flags;
instead, OR the additional flags into them.
|
| |
|
| |
|
|
|
|
| |
that occurred in the document a NAME_SYN entry in the names table.
|
|
|
|
|
|
|
|
| |
Drop the FORM_GZ annotation in the mpages table; it is conceptually wrong
because it ought to be in the mlinks table: An uncompressed .so link file
can point to a compressed manual page file and vice versa.
Besides, it is no longer needed because mparse_open() handles it all.
Sprinkle some KNF while here.
|
|
|
|
|
| |
Don't bother the user with the PID of the child process,
store it inside the opaque mparse handle.
|
|
|
|
|
|
| |
1. Do not mask out NAME_FIRST before its first use.
2. Avoid duplicate NAME_FILE entries.
3. Correctly mask NAME_FILE for .so links.
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
| |
In UTF-8 output, do not print anything if mchars_spec2cp() returns 0.
In particular, this repairs handling of zero-width spaces (\&).
While here, let mchars_spec2cp() return 0xFFFD instead of -1
if the character is not found, simplifying the using code.
In HTML output, do not print obfuscated ASCII characters and
do not test for one-char escapes, mchars_spec2cp() already does that.
|
|
|
|
| |
patch from Martin <Natano at natano dot net>, thanks
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
or an entry in the MANPATH environment variable) does not exist,
silently skip it. This brings makewhatis(8) back closer to the
behaviour of espie@'s version and ought to shut up the weekly(8)
whining observed by henning@ on machines not having xbase installed.
Also, don't error out after the first unusable manpath entry, still
try the others.
Of course, still complain about non-existent directories specified
on the command line and about any directories failing for other
reasons than ENOENT.
|
|
|
|
|
| |
Pages found outside arch-specific dirs still get arch=any, of course.
Issue reported by justinhenryhaynes at gmail dot com on misc@, thanks!
|
| |
|
|
|
|
| |
Implemented by moving the zip code from makewhatis(8) to the parser lib.
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
| |
has already been processed, add the file names to the names table, too,
not just to the mlinks table.
This fixes a bug where apropos(1) and the new man(1) wouldn't find some
of the Xenocara manuals via some of their .so links. After rebuilding,
run "makewhatis /usr/X11R6/man" or just wait for weekly(8).
|
| |
|
|
|
|
|
|
|
|
|
| |
* Make ./configure standalone, that's what people expect.
* Let people write a ./configure.local from scratch, not edit existing files.
* Autodetect wchar, sqlite3, and manpath and act accordingly.
* Autodetect the need for -L/usr/local/lib and -lutil.
* Get rid of config.h.p{re,ost}, let ./configure only write what's needed.
* Let ./configure write a Makefile.local snippet, that's quite flexible.
|
|
|
|
|
|
| |
I chose the OpenBSD version because it apparently contains various
bugfixes that never made it into libnbcompat. To reduce size and
complexity, i stripped out the features we don't need.
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
| |
in particular relaxing the distinction between prologue and body
and further improving messages.
* The last .Dd wins and the last .Os wins, even in the body.
* The last .Dt before the first body macro wins.
* Missing title in .Dt defaults to UNTITLED. Warn about it.
* Missing section in .Dt does not default to 1. But warn about it.
* Do not warn multiple times about the same mdoc(7) prologue macro.
* Warn about missing .Os.
* Incomplete .TH defaults to empty strings. Warn about it.
|
|
|
|
|
|
| |
is "const unsigned char *", which causes warnings with GCC on Linux.
Explicitly cast to "const char *" to avoid this.
Issue noticed by kristaps@.
|
|
|
|
|
| |
with "mandoc: " or "makewhatis: ", respectively,
similar to what we already do for other messages.
|
|
|
|
|
|
| |
* rename the halloc callback to calloc, provide overflow protection
* rename the hfree callback to free, drop the useless size argument
* prevent integer overflows in ohash_resize
|