Commit Graph

155 Commits

Author SHA1 Message Date
lukem c4b7a9e794 bsd.own.mk: rename GCC_NO_* to CC_WNO_*
Rename compiler-warning-disable variables from
	GCC_NO_warning
to
	CC_WNO_warning
where warning is the full warning name as used by the compiler.

GCC_NO_IMPLICIT_FALLTHRU is CC_WNO_IMPLICIT_FALLTHROUGH

Using the convention CC_compilerflag, where compilerflag
is based on the full compiler flag name.
2023-06-03 09:09:01 +00:00
gutteridge c24f08c108 man.conf.5: improve wording on searching alternate machine paths
As requested by uwe@. Hopefully this is clearer now.
2022-06-19 18:51:06 +00:00
uwe 1a1a1e7580 man.conf(5): Tweak formatting for prettier PS output. 2022-06-18 13:41:12 +00:00
gutteridge 34d3d51550 man.conf.5: add details about the machine line and search order
Also, tweak some grammar, style, and markup while here.
2022-06-18 02:19:07 +00:00
gutteridge 8629ce791c man.1: add a small note about alternate machine name searches 2022-06-18 02:14:39 +00:00
gutteridge a8d88dfa77 man.c: minor KNF 2022-05-10 00:42:00 +00:00
rillig 08cb0b9a96 man: remove unused global variable 'instype' (since yesterday)
No functional change.
2022-03-08 23:13:05 +00:00
rillig 464029217b man: remove trailing whitespace
No binary change.
2022-03-08 23:09:36 +00:00
rillig d834ba5cf2 man: fix type mismatch between enum and int (since yesterday)
No binary change.
2022-03-08 23:05:32 +00:00
gutteridge ce25000ddd man.c: fix -m option so it works as documented
Refactoring work in man.c r. 1.40 from twelve years ago introduced a
regression where input from the -m option was appended rather than
prepended to the search paths. Problem reported by C. Chapman on
netbsd-users.
2022-03-07 22:43:39 +00:00
maya b0f199cb12 Exit successfully after printing the search path, stop further processing.
Continuing to process had the unintended effect that `man` failed to find
a matching manual page for {EMPTY LIST OF REQUESTED MANUAL PAGES}, and
exited with 1.

Prompted by a fish shell snippet that tried and failed to distinguish between
FreeBSD man (-p takes argument) and NetBSD man (-p no argument) by comparing
`man -p` exit code.

ok riastradh, logix (which also pointed out the manual page SYNOPSIS is
saying man -p should be used this way).
2020-04-06 19:53:22 +00:00
mrg de11d87641 introduce some common variables for use in GCC warning disables:
GCC_NO_FORMAT_TRUNCATION    -Wno-format-truncation (GCC 7/8)
GCC_NO_STRINGOP_TRUNCATION  -Wno-stringop-truncation (GCC 8)
GCC_NO_STRINGOP_OVERFLOW    -Wno-stringop-overflow (GCC 8)
GCC_NO_CAST_FUNCTION_TYPE   -Wno-cast-function-type (GCC 8)

use these to turn off warnings for most GCC-8 complaints.  many
of these are false positives, most of the real bugs are already
commited, or are yet to come.


we plan to introduce versions of (some?) of these that use the
"-Wno-error=" form, which still displays the warnings but does
not make it an error, and all of the above will be re-considered
as either being "fix me" (warning still displayed) or "warning
is wrong."
2019-10-13 07:28:04 +00:00
mrg 2951cf94c8 move 'utsname' to the main() function scope, so that the reference to
it outside the block remains valid.

should fix an asan reported issue.
2018-06-15 20:16:35 +00:00
abhinav 5652c781e4 Teach man -p to respect the MANPATH environment variable and the -M option.
Currently, `man -p` generates its output based on the value of the _default tag
in man.conf. However, man(1) modifies its search path based on the value of the
MANPATH variable and the list of directories specified via the -M option. In such
a case, `man -p` does not represent the correct search path. This commit intends
to fix this.

This change has the side effect that now the output of `man -p` will also include
the machine class specific subdirectories (such as man8/x86), while previously it
did not. The output would include subdirectories only for those machine classes
which are specified in the man.conf file.

Also, with this change, it is possible to run makemandb(8), by setting MANPATH
environment variable (e.g. env MANPATH=/usr/share/man makemandb).

Patch reviewed by wiz@
2017-05-02 14:19:23 +00:00
abhinav bf229e85c5 Fix comment indentation at couple of places: Use \t instead of space 2017-04-27 09:31:50 +00:00
abhinav f2d77fdf32 Replace makewhatis(8) with makemandb(8) in SEE ALSO. 2016-06-16 15:11:43 +00:00
abhinav edcef964c4 Document -f option for man(1).
Also remove unsupported options for `man -k` from the synopsis and usage.
2016-06-16 15:10:58 +00:00
christos 8ed051d1e1 put back _PATH_WHATIS, it is used. 2016-05-21 20:54:34 +00:00
abhinav aa0cdec039 Remove unused include and unused constant. Ok from christos@. 2016-05-21 17:21:40 +00:00
plunky 312b53dde5 change _whatdb => _mandb as that is the correct keyword here,
and move it to the correct position in the list.
2015-04-07 10:17:21 +00:00
christos c7da06e6d1 there is no more makewhatis; it has been replaced by makemandb 2015-03-03 17:59:32 +00:00
apb 3453b7f9d9 More detail about treating a local file as a man page,
and about how to request machine-specific man pages.
re
2014-08-14 15:44:47 +00:00
apb ee28f0e59d For an argument to be interpreted as a local file name, bypassing the
search rules in man.conf or MANPATH, it must begin with "/", "./", or
"../".  Simply testing whether it contains "/" is wrong, because it
breaks usage like "man 8 vax/boot".

This reverts revision 1.57 dated 2013-10-06,
"Be more permissive in interpreting man pages as filenames".
2014-08-14 15:31:12 +00:00
riastradh 6cb10275d0 Merge riastradh-drm2 to HEAD. 2014-03-18 18:20:35 +00:00
uwe 28b0656f7c config() in manconf.c now verifies _build (and _crunch) command
templates with fmtcheck(3) so annotate the printf that uses these
commands as safe with a __format_arg wrapper and drop
-Wno-format-nonliteral.

XXX: Using local wrapper for now, solving this in general would be
nice, but it raises namespace pollution issues.

XXX^2: catman(8) also uses manconf.c and uses _build and _crunch so it
can also benefit from this (but see above).
2014-02-17 03:10:12 +00:00
uwe 20ec07777a Check _build and _crunch commands with fmtcheck(3), warn about and
ignore bad ones.
2014-02-17 02:53:48 +00:00
christos 094fa0251a Instead of guessing the suffix in the code, use the suffix list previously
loaded via man.conf(5). While there, zap unused iteration code.
(Franco Fichtner)
2013-10-28 23:46:17 +00:00
christos 8818316ba3 add more compression suffixes and local suffixes. 2013-10-06 17:14:49 +00:00
christos b496a26a9d Recognize .gz and .bz2 suffixes so $ man ./man.1.gz works. From Franco Fichter
via dfly.
2013-10-06 16:43:41 +00:00
christos 7d79a7ccd9 Be more permissive in interpreting man pages as filenames, from Franco
Fichter via dfly. fixes:
	$ man usr.bin/man/man.1
2013-10-06 16:29:26 +00:00
joerg 349a581e92 Mark the dead. 2013-07-30 15:10:04 +00:00
uwe 2a44517182 Constify some more. 2013-07-19 05:05:59 +00:00
uwe 4e29a793cc Spell "keywords" without space. Fix couple of typos. 2013-07-19 04:59:46 +00:00
uwe 6a118683e9 manual_find_buildkeyword() - now that we control the format string, we
may use asterisk precision specification instead of temporary
modifying the _build string itself.
2013-07-19 04:55:05 +00:00
uwe 6fed3e8105 Fix manual_find_buildkeyword() to not use non-literal printf format. 2013-07-19 04:18:10 +00:00
uwe fd25be260e Use -Wno-format-nonliteral instead of blanket -Wno-format. 2013-07-19 04:17:02 +00:00
uwe 887d84a8cf Don't access memory outside the array if tmpdirlen == 0. 2013-07-18 16:33:31 +00:00
christos f75400a6b8 use -Wno-format and revert "fixstring" 2013-07-18 16:28:52 +00:00
christos 532207c739 Set the string to NUL instread of providing an new empty string (from uwe) 2013-07-18 16:01:25 +00:00
christos ef965bff9b WARNS=6
- fix cast qual issues
- don't use snprintf on a user-provided buffer
2013-07-18 15:39:08 +00:00
uwe a2ec5e5863 Revert previous; other errors from WARNS=3 obscured the error in jump(). 2013-07-18 04:05:32 +00:00
uwe d7a42acd68 Constify jump() arguments appropriately. 2013-07-18 04:02:31 +00:00
uwe e0d6c9b51f Move manstate::pagerlen so that its "length of the above" comment makes sense. 2013-07-18 03:48:22 +00:00
uwe 3403b722b4 whatis.db is no more, so don't mention its location in FILES. 2013-07-18 03:40:31 +00:00
uwe db23d137fa Remove unnecessary line wrap. 2013-07-18 03:38:25 +00:00
wiz a87a4e005d Prefer Aq to \*[Lt] etc. 2013-06-28 10:13:18 +00:00
jdf eb2a9790dd * adjust indentation of list block
* fix capitalization
 * remove superfluous word ('The')

Patch supplied by Bug Hunting.
2013-06-27 21:55:10 +00:00
christos 6d6339ce42 document _machine 2012-04-29 03:46:43 +00:00
joerg c09f2f1d25 If the default path doesn't result in a match, bail out early instead of
running into a segmentation fault. Based on patch by Abhinav Upadhyay.
2012-01-03 17:49:57 +00:00
apb 25998b2e56 Document the reality that the _build and _crunch commands should each
contain exactly one "%s".  The previous description allowed any number
of "%s" in the _build command, but that does not match the actual
behaviour of either man(1) or catman(8).
2011-12-27 13:15:55 +00:00