Commit Graph

35 Commits

Author SHA1 Message Date
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
elad c8399f93d6 Fix buffer overflow. We don't really care about trimming the filename here.
PR/28739, from Michael Santos.
2005-09-17 19:18:31 +00:00
xtraeme 971b39df9c Kill __P(), use ANSI function declarations. 2005-02-17 16:53:45 +00:00
dsl 3cca093e74 Add (unsigned char) cast to ctype functions 2004-10-30 15:51:20 +00:00
jmmv b635f565e7 Homogenize usage messages: make the 'usage' word all lowercase, as this seems
to be the most common practice in our tree.
2004-01-05 23:23:32 +00:00
agc 89aaa1bb64 Move UCB-licensed code from 4-clause to 3-clause licence.
Patches provided by Joel Baker in PR 22365, verified by myself.
2003-08-07 11:13:06 +00:00
lukem 3bcb486fa2 - revert change to accessing ../man/ includes as <man/xxx.h>; it's
ugly to add -I.../usr.bin to do this.  instead, add appropriate
  comments in the source to where the files are actually coming from.
- use NETBSDSRCDIR as appropriate
- some minor makefile delint
2002-09-19 11:29:54 +00:00
mycroft c2fdc50a4d config.[ch] -> manconf.[ch] 2002-09-13 20:16:40 +00:00
lukem 60ca6c1a6a cleanup TAILQ use 2002-06-11 07:17:15 +00:00
itojun c881cd65e2 make it compile; sync w/ usr.bin/man change 2002-06-11 05:46:50 +00:00
jdolecek 215ac5cf9b document -C option, add /etc/man.conf to FILES and xref man.conf(5) 2002-03-08 20:27:41 +00:00
jdolecek 0f794d6d71 use -I${CURDIR}/.. and #include <man/config.h>, <man/pathnames.h> so
that it's easier to tell from where do they come, and more easily
  usable in host tool code when cut&pasted
use TAILQ_* macros as apropriate
use EXIT_FAILURE for the glob error case, too
2002-03-08 20:23:10 +00:00
cgd a8ec668ddf convert to use getprogname() 2001-02-19 23:03:42 +00:00
christos 8f3b31ba6f fix nested extern 2001-02-05 01:21:00 +00:00
lukem 279552d3db fix up various .Nm abuses:
- keep the case consistent between the actual name and what's referenced.
  e.g, if it's `foo', don't use '.Nm Foo' at the start of a sentence.
- remove unnecessary `.Nm foo' after the first occurrence (except for
  using `.Nm ""' if there's stuff following, or for the 2nd and so on
  occurrences in a SYNOPSIS
- use Sx, Ic, Li, Em, Sq, and Xr as appropriate
2000-11-07 06:43:24 +00:00
christos 1a67b18deb char -> unsigned char 1998-11-06 22:29:44 +00:00
ross 034eedfe44 Add missing .El 1998-10-15 08:18:46 +00:00
kleink d39ba37ccb Since GLOB_NOCHECK is not set, explicitly check for a return value of
GLOB_NOMATCH from glob().  Noticed by Juergen Hannken-Illjes.
1998-07-06 14:23:31 +00:00
kleink fc5d36f8e4 GLOB_QUOTE is dead; per POSIX, backslash quoting of special characters being
enabled is the default behaviour.
1998-06-19 22:58:04 +00:00
fair 2249fd4c1a add .Xr makewhatis 8 1998-04-09 09:12:44 +00:00
mrg 81a056bc2e handle strings longer than 256 bytes. should do this with fgetln()...but
fgetln() doesn't nul terminate, and thus requires malloc/copy for each
interation (actually, *two* for whatis(1)).
1997-11-12 00:04:49 +00:00
mikel 44fd5cbf64 fix PR 4292 slightly differently 1997-10-20 23:02:09 +00:00
lukem ec92bfb4f7 don't dump core if the search path contains a non-existant whatis.db file
from Dave Huang <khym@bga.com> in [bin/4292]
1997-10-20 02:11:32 +00:00
mikel d00b77f18b now needs -I to find headers from ../man 1997-10-17 06:51:04 +00:00
mikel 9653f53ecf cleanup for WARNS=1; also avoid using relative paths with #include, and
avoid using the contents of an array outside of its scope.
1997-10-17 06:49:16 +00:00
mikel effc153920 add support for globbing _whatdb entries in man.conf; from Mike
Grupenhoff in PR bin/1904.
1997-10-16 08:44:23 +00:00
gwr 10e180cc49 Back out the .PATH.c changes. The .depend problem (and others)
will be fixed using the new .NOPATH make feature instead.
1997-05-08 21:11:01 +00:00
gwr 012e528f2e Use .PATH.c: ... 1997-05-06 20:44:56 +00:00
tls 9d225a1783 RCS ID police 1997-01-09 20:18:21 +00:00
tls b1db8b2668 Sync with 4.4lite2 1995-09-04 20:46:14 +00:00
glass daca2c10b4 oops 1995-03-26 02:22:13 +00:00
glass 0a334e76e7 cleanup old import 1995-03-25 04:36:52 +00:00
glass 7711afad47 update to 4.4-lite, add rcs ids 1994-09-25 07:55:08 +00:00
glass 6662274f56 import from 4.4 lite 1994-09-25 07:20:52 +00:00
cgd 44aa388738 add apropos(1); part of new man(1) package from Bostic 1993-12-21 02:56:27 +00:00