summaryrefslogtreecommitdiffstats
path: root/libexec/getNAME
diff options
context:
space:
mode:
authorcharnier <charnier@FreeBSD.org>1997-11-21 07:40:48 +0000
committercharnier <charnier@FreeBSD.org>1997-11-21 07:40:48 +0000
commit8191848c3fe6cf7a39563a64975e0b607295e35d (patch)
tree64dfd8789df6d6a62ee97c75b3de87d7a1f09fb3 /libexec/getNAME
parent17df8f3da3d8554622eb7bc4660a7e7b363c1bfe (diff)
downloadFreeBSD-src-8191848c3fe6cf7a39563a64975e0b607295e35d.zip
FreeBSD-src-8191848c3fe6cf7a39563a64975e0b607295e35d.tar.gz
Use err(3). -Wall cleaning.
Diffstat (limited to 'libexec/getNAME')
-rw-r--r--libexec/getNAME/getNAME.112
-rw-r--r--libexec/getNAME/getNAME.c20
2 files changed, 17 insertions, 15 deletions
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 <err.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <unistd.h>
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");
OpenPOWER on IntegriCloud