From 8191848c3fe6cf7a39563a64975e0b607295e35d Mon Sep 17 00:00:00 2001 From: charnier Date: Fri, 21 Nov 1997 07:40:48 +0000 Subject: Use err(3). -Wall cleaning. --- libexec/getNAME/getNAME.1 | 12 ++++++------ libexec/getNAME/getNAME.c | 20 +++++++++++--------- 2 files changed, 17 insertions(+), 15 deletions(-) (limited to 'libexec/getNAME') diff --git a/libexec/getNAME/getNAME.1 b/libexec/getNAME/getNAME.1 index c58bbe2..d292ab6 100644 --- a/libexec/getNAME/getNAME.1 +++ b/libexec/getNAME/getNAME.1 @@ -22,7 +22,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id$ +.\" $Id: getNAME.1,v 1.6 1997/02/22 14:21:34 peter Exp $ .Dd July 8, 1996 .Dt getNAME 1 @@ -33,7 +33,7 @@ .Sh SYNOPSIS .Nm /usr/libexec/getNAME .Op Fl itw -.Ar files ... +.Ar .Sh DESCRIPTION The .Nm @@ -45,13 +45,13 @@ building database entries. .Pp The options are as follows: -.Bl -tag -width Ds +.Bl -tag -width indent .It Fl i -for building intro entries. +For building intro entries. .It Fl t -for building toc. +For building toc. .It Fl w -print type of manual page (OLD, NEW, UNKNOWN). +Print type of manual page (OLD, NEW, UNKNOWN). .El .\" .Sh BUGS .Sh SEE ALSO diff --git a/libexec/getNAME/getNAME.c b/libexec/getNAME/getNAME.c index 2961ecf..87da702 100644 --- a/libexec/getNAME/getNAME.c +++ b/libexec/getNAME/getNAME.c @@ -29,19 +29,20 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $Id: getNAME.c,v 1.4 1997/02/22 14:21:35 peter Exp $ - * */ #ifndef lint -static char copyright[] = +static const char copyright[] = "@(#) Copyright (c) 1980, 1993\n\ The Regents of the University of California. All rights reserved.\n"; #endif /* not lint */ #ifndef lint +#if 0 static char sccsid[] = "@(#)getNAME.c 8.1 (Berkeley) 6/30/93"; +#endif +static const char rcsid[] = + "$Id$"; #endif /* not lint */ /* @@ -50,9 +51,11 @@ static char sccsid[] = "@(#)getNAME.c 8.1 (Berkeley) 6/30/93"; * -i for building intro entries * other apropos database */ +#include #include #include #include +#include int tocrc; int intro; @@ -63,14 +66,13 @@ void dorefname __P((char *)); void getfrom __P((char *)); void split __P((char *, char *)); void trimln __P((char *)); -void usage __P((void)); +static void usage __P((void)); int main(argc, argv) int argc; char *argv[]; { - extern int optind; int ch; while ((ch = getopt(argc, argv, "itw")) != -1) @@ -108,10 +110,10 @@ getfrom(pathname) char linbuf[BUFSIZ]; if (freopen(pathname, "r", stdin) == 0) { - perror(pathname); + warn("%s", pathname); return; } - if (name = strrchr(pathname, '/')) + if ((name = strrchr(pathname, '/'))) name++; else name = pathname; @@ -333,7 +335,7 @@ again: putchar (*dp++); } -void +static void usage() { (void)fprintf(stderr, "usage: getNAME [-itw] file ...\n"); -- cgit v1.1