summaryrefslogtreecommitdiff
path: root/usr.bin/ranlib/ranlib.c
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>1999-09-21 13:15:44 +0000
committerMarc Espie <espie@cvs.openbsd.org>1999-09-21 13:15:44 +0000
commit4ecdc1954f4fbdcb4552591930031f4e3396fbe8 (patch)
treea53dd5479f3236a73e41aa449c54a6df41483f63 /usr.bin/ranlib/ranlib.c
parent1b50297182d0c8ea155fe81bf00514b453081f08 (diff)
Build some proper prototypes, fix minor nits.
Add some proper error handling to object file parsing, deciding whether it's a bad object file or something ranlib should not care about, so that archives that mix non object files with object files don't get killed by the `mixed object archive' check.
Diffstat (limited to 'usr.bin/ranlib/ranlib.c')
-rw-r--r--usr.bin/ranlib/ranlib.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/usr.bin/ranlib/ranlib.c b/usr.bin/ranlib/ranlib.c
index 17e9817a557..0940ee125e4 100644
--- a/usr.bin/ranlib/ranlib.c
+++ b/usr.bin/ranlib/ranlib.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ranlib.c,v 1.3 1997/01/15 23:43:04 millert Exp $ */
+/* $OpenBSD: ranlib.c,v 1.4 1999/09/21 13:15:43 espie Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@@ -44,7 +44,7 @@ char copyright[] =
#ifndef lint
/*static char sccsid[] = "from: @(#)ranlib.c 5.6 (Berkeley) 2/26/91";*/
-static char rcsid[] = "$OpenBSD: ranlib.c,v 1.3 1997/01/15 23:43:04 millert Exp $";
+static char rcsid[] = "$OpenBSD: ranlib.c,v 1.4 1999/09/21 13:15:43 espie Exp $";
#endif /* not lint */
#include <sys/types.h>
@@ -52,11 +52,17 @@ static char rcsid[] = "$OpenBSD: ranlib.c,v 1.3 1997/01/15 23:43:04 millert Exp
#include <stdio.h>
#include <stdlib.h>
#include <archive.h>
+#include "extern.h"
CHDR chdr;
u_int options; /* UNUSED -- keep open_archive happy */
+
char *archive;
+static void
+usage();
+
+int
main(argc, argv)
int argc;
char **argv;
@@ -84,6 +90,7 @@ main(argc, argv)
exit(eval);
}
+static void
usage()
{
(void)fprintf(stderr, "usage: ranlib [-t] archive ...\n");