Commit Graph

136 Commits

Author SHA1 Message Date
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
mbalmer 947c965b88 Refer to X11R7. 2011-10-07 10:52:31 +00:00
wiz 6d765c9977 Fix usage in man page and sync usage in executable with it. 2011-06-14 20:08:45 +00:00
joerg 2d9f8bf04f Add support for man -p to print the search path for manual pages (not
including cat page directories).

From Abhinav Upadhyay as part of Google's Summer of Code 2011
2011-06-14 18:53:48 +00:00
christos e2d47bd7fa get the value of the entry for the class not the key. 2010-07-07 21:24:34 +00:00
christos cbc22ad229 - centralize the snprintf code.
- use err where appropriate.
- add machclass which should be x86 when i386 and amd64 and can be specified
  in man.conf as:
	_i386	x86
	_amd64	x86
  so that we can support merged pages. Nothing uses this yet.
2010-05-23 22:04:36 +00:00
cegger 656e85b2f1 Mimic OSX behaviour:
On OS X it is possible to specify the manpage filename
with a full or relative path like this:

   man ./foo.5

or

   man /cd/foo/bar.1.gz

This is really helpful to view the manpage quickly while editing it.

patch presented on current-users@ and tech-userlevel@:
http://mail-index.netbsd.org/current-users/2009/10/06/msg010767.html
http://mail-index.netbsd.org/tech-userlevel/2009/10/06/msg002675.html

No objections
2009-10-07 08:30:31 +00:00
cegger 58b5db465d - use EXIT_FAILURE/EXIT_SUCCESS
- whitespace nits
- ansify cleanup()/usage()
- remove pointless parenthesis on return
2009-10-06 06:43:15 +00:00
lukem c1ceae17f0 Enable WARNS=4 by default for usr.bin, except for:
awk  bdes  checknr  compile_et  error  gss  hxtool  kgetcred  kinit
	klist  ldd  less  lex  locale  login  m4  man  menuc  mk_cmds
	mklocale  msgc  openssl  rpcgen  rpcinfo  sdiff  spell  ssh
	string2key  telnet  tn3270  verify_krb5_conf  xlint
2009-04-14 22:15:16 +00:00
lukem 98e5374ccb Remove the \n and tabs from the __COPYRIGHT() strings.
Tweak to use a consistent format.
2008-07-21 14:19:20 +00:00
christos 6f6f89d28a pass lint, from anon ymous 2008-03-08 15:48:27 +00:00
lukem c9c455bf1d Convert to using raise_default_signal(3). 2007-10-05 07:36:45 +00:00
reed a87b66bd95 Add "catman" to the SEE ALSO. 2007-02-10 19:27:39 +00:00
jwise b6bad2e5f2 Since MAN_DEBUG is constant, go from if (MAN_DEBUG) to #if MAN_DEBUG 2007-02-05 19:46:24 +00:00
peter e263dfd62f WFORMAT is no more... 2006-10-08 17:52:28 +00:00
christos 83d63c0a25 Coverity CID 2996: Don't return without closing fp. 2006-05-01 23:22:48 +00:00
wiz 3aec927b7b Bump date for previous.
New sentence, new line.
Remove trailing whitespace.
2006-04-13 21:15:50 +00:00
wiz afd4fdef89 Bump date for previous, slightly reword a sentencen. 2006-04-13 21:10:44 +00:00
chuck 02ff9e80b9 fix .Xr to invalid man page that i put in by mistake 2006-04-10 16:20:46 +00:00
chuck d09fe2c467 modified man(1):
- avoid double slashes when displaying man pages (got tired
   of '/usr/share/man//cat1/man.0').
 - got rid of __P() while working on it.
 - incorporate some of my old notes explaining how manpath works into the
   comments of the code itself.
 - renamed some of the vars so that the code is consistent throughout
   (and hopefully clearer and easier to understand)
 - fixed relative man paths for multiple man pages (man did a chdir()
   on the first man page it had to format --- this broke any remaining
   relative path man pages left to process).   save old directory and
   fchdir() back to it after formatting.
 - improved doc on "man -h" which does more than just whatis(1) [e.g.
   "man -h fopen" prints the required include files and the prototypes
   rather than just the one-liner you get with whatis(1)]
 - manconf.c now fills in the "len" length field in the TAG/ENTRY
   structures (man now uses len).

revise man.conf file reading stuff to return error on failure in
addentry/gettag (fka getlist) rather than just err()ing out.   this
allows man(1) to call cleanup and delete its tmp files rather than
just leave them floating.  revise other apps using this code
(makewhatis, apropos, catman, whatis) to expect this.  also remove
__P on updated files.
2006-04-10 14:39:06 +00:00